Re: auto-increment column

Поиск
Список
Период
Сортировка
От Boszormenyi Zoltan
Тема Re: auto-increment column
Дата
Msg-id 4E8AFB13.9060905@cybertec.at
обсуждение исходный текст
Ответ на Re: auto-increment column  (Robert Buckley <robertdbuckley@yahoo.com>)
Список pgsql-general
Hi,

2011-10-04 14:05 keltezéssel, Robert Buckley írta:
Thanks for the replies,

I have one question regarding this comment...

"You also need to add a DEFAULT expression and optionally
make the sequence owned by the column:"

What difference does it make if a table "owns" a sequence of not?...does this contraint the use of the sequence to ONLY that one table?

The sequence will only be used to auto-increment the id column in order to have an automatic primary key. Could I then somehow use the sequence for all tables which need this?

yours,

Rob

please, don't use top-posting. It messes up the order of the messages.

The sequenced that is OWNED BY a column can of course be used
by other columns in other tables. You can specify nextval('same sequence')
for any number of columns' default value.

Best regards,
Zoltán Böszörményi

-- 
----------------------------------
Zoltán Böszörményi
Cybertec Schönig & Schönig GmbH
Gröhrmühlgasse 26
A-2700 Wiener Neustadt, Austria
Web: http://www.postgresql-support.de    http://www.postgresql.at/

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

Предыдущее
От: Robert Buckley
Дата:
Сообщение: Re: auto-increment column
Следующее
От: senthilnathan
Дата:
Сообщение: PG Source Compilation (Optional Features / Optional Packages)