autoincrement???

Поиск
Список
Период
Сортировка
От Markus Jais
Тема autoincrement???
Дата
Msg-id 3B4E1487.1FEA4A8F@web.de
обсуждение исходный текст
Ответы Re: autoincrement???  (Philip Hallstrom <philip@adhesivemedia.com>)
Re: autoincrement???  (Jason Earl <jdearl@yahoo.com>)
RE: autoincrement???  ("Kevin Bullaughey" <kevin@gambitdesign.com>)
Список pgsql-general
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

В списке pgsql-general по дате отправления:

Предыдущее
От: Somazx Interesting
Дата:
Сообщение: compile error
Следующее
От: Somazx Interesting
Дата:
Сообщение: Re: compile error