Re: Newbie Question
От
Ludwig Meyerhoff
Тема
Re: Newbie Question
Дата
Msg-id
Pine.LNX.4.21.0105042250020.4404-100000@ludwig
Ответ на
Newbie Question (Clay & Judi Kinney)
Список
Дерево обсуждения
Newbie Question "Clay & Judi Kinney" <cricketk@home.com>
Re: Newbie Question Joel Burton <jburton@scw.org>
Re: Newbie Question Ludwig Meyerhoff <ludwig@antar.com>
Re: Newbie Question Peter Eisentraut <peter_e@gmx.net>
Hallo!
> How do I create an autoincrement field in a postgresql table???
> What are the correct field type and parameters????
Well, what about using sequences?
create sequence tralalala;
create table huibui
(
id integer primary key default nextval('tralalala'),
field1 references table1,
and-so-on references all-other-tables
);
How, each time You insert some data in huibui using
insert into huibui (field1, and-son-on) values (?, ..);
the 'tralala' counter will be increased by one (nextval).
Saluti!
Ludwig
В списке pgsql-general по дате отправления