Search Postgresql Archives

Re: auto-increment column

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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/

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux