Re: more-than-one-SERIAL column per table

Поиск
Список
Период
Сортировка
От Jeff Daugherty
Тема Re: more-than-one-SERIAL column per table
Дата
Msg-id 3AF99493.4050805@greatbridge.com
обсуждение исходный текст
Ответ на Re: Problems w. SERIAL  (Morten Primdahl <morten@primdahl.net>)
Список pgsql-general
I see no reason why a second SERIAL column would be needed.  As in the
example for creating tbl_c, when you have a SERIAL as a primary  key,
the foreign keys that reference it should be int4 not SERIAL.
jeff


Jeff Daugherty
Database Systems Engineer
Great Bridge LLC

will trillich wrote:

> On Sun, May 06, 2001 at 02:59:31AM +0200, Morten Primdahl wrote:
>
>>> \d tbl_c_id_seq
>>>
>>> if it is not there, you can create it yourself
>>
>> Thanks, the sequence was not there. Just puzzled me that
>> when creating tbl_c, I get:
>>
>> test=# CREATE TABLE tbl_c
>>  (id SERIAL PRIMARY KEY,
>>   data VARCHAR(50),
>>   a SERIAL CONSTRAINT a_ref REFERENCES tbl_a(id),
>>   b SERIAL CONSTRAINT b_ref REFERENCES tbl_b(id)
>> );
>
>
> is there any paradigm wherein TWO serial values for one table
> might possible be useful? (since serial is really "int default
> nextval('sequence_seq')" how can the second serial be anything
> but redundant?)


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

Предыдущее
От: Joel Burton
Дата:
Сообщение: Re: more-than-one-SERIAL column per table
Следующее
От: "Brent R. Matzelle"
Дата:
Сообщение: Re: MS SQL 7.0 to PostgreSQL 7.1