Re: duplicate key violates unique constraint

Поиск
Список
Период
Сортировка
От Carol Walter
Тема Re: duplicate key violates unique constraint
Дата
Msg-id E3E7F72F-A86C-437E-A41D-EFD295195FD8@indiana.edu
обсуждение исходный текст
Ответ на Re: duplicate key violates unique constraint  (Jim Nasby <decibel@decibel.org>)
Список pgsql-admin
Yes, I've seen "serial" used in other places than the primary key,
but I was referring to Greg's output.  The data type for the sequence
is listed as "bigint".  My thought was that the data type was listed
as "serial" for sequences.  I just looked at my database and I was
wrong about that.  It does list the data type as an integer when you
"describe" the table.

Carol

On May 10, 2007, at 5:17 PM, Jim Nasby wrote:

> On May 10, 2007, at 9:01 AM, Carol Walter wrote:
>> And this is more than a question than an answer, but I thought
>> that sequences had to designated as data type "serial."
>
> Nope... sequences are actually completely un-related to tables. You
> can define a sequence that's not referenced by any table. The
> serial data type is essentially a 'macro' that:
>
> Creates a sequence
> Sets the default value for the field to be the nextval() of that
> sequence
> Sets the field to be NOT NULL
> --
> Jim Nasby                                            jim@nasby.net
> EnterpriseDB      http://enterprisedb.com      512.569.9461 (cell)
>
>


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

Предыдущее
От: Jim Nasby
Дата:
Сообщение: Re: duplicate key violates unique constraint
Следующее
От: "Spiegelberg, Greg"
Дата:
Сообщение: Re: duplicate key violates unique constraint