One sequence for different tables

Поиск
Список
Период
Сортировка
От Robert.Farrugia@go.com.mt
Тема One sequence for different tables
Дата
Msg-id 20020311142129.6DEB54759B1@postgresql.org
обсуждение исходный текст
Ответы Re: One sequence for different tables  (Bruno Wolff III <bruno@wolff.to>)
Re: One sequence for different tables  (Peter Eisentraut <peter_e@gmx.net>)
Re: One sequence for different tables  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
Список pgsql-admin
Hi,

Is it possible to create one sequence to be used for more than one table ?
Let's say I create a pkey_seq sequence.
Can I use it in table A (pkey default nextval('pkey_seq') PRIMARY KEY) and
in table B as (pkey default nextval('pkey_seq') PRIMARY KEY) ?
Is it safe in that each table will have unique values i.e. if I have a
third table C which is used to link data both from A and B using the pkey
field, will there be records having the same pkey but from different
tables?

Thanks alot
Robert


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

Предыдущее
От: "Matthew D. Fuller"
Дата:
Сообщение: Re: Postgres not starting at boot(FreeBSD) - startup script not releasing < solved
Следующее
От: Robert.Farrugia@go.com.mt
Дата:
Сообщение: Difference between VARCHARs