Re: ERROR: null value in column "id" violates not-null constraint

Поиск
Список
Период
Сортировка
От Robert Paulsen
Тема Re: ERROR: null value in column "id" violates not-null constraint
Дата
Msg-id 200910101529.15690.robert@paulsenonline.net
обсуждение исходный текст
Ответ на Re: ERROR: null value in column "id" violates not-null constraint  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: ERROR: null value in column "id" violates not-null constraint  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-sql
On Saturday 10 October 2009 3:16 pm, Tom Lane wrote:
> Robert Paulsen <robert@paulsenonline.net> writes:
> > On Saturday 10 October 2009 2:00 pm, Robert Paulsen wrote:
> >> So no default for id. What should it be?
> >> default nextval('vault_id_seq')
> >
> > Should have tried that before posting last message -- it worked. Thanks!
>
> So the next question is just what happened and whether you're missing
> anything else from the original database state ...
>
>             regards, tom lane

Well, there was one other table with a sequence as a primary key and that was 
lost also. Otherwise nothing else was wrong. I went through a dump/restore 
cycle after fixing things and it all worked.

I do have a question, though, I fixed things as indicated above: id integer DEFAULT nextval('vault_id_seq') NOT NULL,
Dump gave backid integer DEFAULT nextval('vault_id_seq'::text) NOT NULL,
That "text" seems odd. Should I change it?


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: ERROR: null value in column "id" violates not-null constraint
Следующее
От: Tom Lane
Дата:
Сообщение: Re: ERROR: null value in column "id" violates not-null constraint