Re: autoincrement??? - Mailing list pgsql-general

From Ben-Nes Michael
Subject Re: autoincrement???
Date
Msg-id 005701c10b62$0518daa0$aa5796d4@canaan.co.il
Whole thread Raw
In response to autoincrement???  (Markus Jais <mjais@web.de>)
List pgsql-general
Use the Serial type for address_id.
And you should read the Manuals ! :)

----- Original Message -----
From: "Markus Jais" <mjais@web.de>
To: <pgsql-general@postgresql.org>
Sent: Friday, July 13, 2001 12:20 AM
Subject: [GENERAL] autoincrement???


> hi
> I have the following problem:
>
> I create the following table:
>
> CREATE TABLE address (
>         address_id int  PRIMARY KEY ,
>         street     VARCHAR(40),
>         zipcode    INT,
>         city       VARCHAR(40),
>         country    VARCHAR(40)
> );
>
> Now, I want the address_id to get incremented
> every time I insert a value into the table.
>
> for example:
> INSERT INTO address VALUES('mainstreet 12', 85253, 'munich', 'Germany')
> ;
> without specifying a value for the id.
>
> a friend told me, that this works in MySQL with something
> like "auto_increment". I do not know much about MySQL so I do not
> know if this is true.
>
> Can you please tell me, how to do this in postgresql????
>
> thanks a lot
> regards
> markus
>
> --
> Markus Jais
> http://www.mjais.de
> info@mjais.de
> The road goes ever on and on - Bilbo Baggins
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo@postgresql.org so that your
> message can get through to the mailing list cleanly
>


pgsql-general by date:

Previous
From: Ed Loehr
Date:
Subject: Re: Visual Modeling programs
Next
From: Keith F Irwin
Date:
Subject: Postgresql & Python 2