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

From: Robert Paulsen <robert(at)paulsenonline(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: ERROR: null value in column "id" violates not-null constraint
Date: 2009-10-10 20:29:15
Message-ID: 200910101529.15690.robert@paulsenonline.net
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Saturday 10 October 2009 3:16 pm, Tom Lane wrote:
> Robert Paulsen <robert(at)paulsenonline(dot)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 back
id integer DEFAULT nextval('vault_id_seq'::text) NOT NULL,
That "text" seems odd. Should I change it?

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2009-10-10 21:12:31 Re: ERROR: null value in column "id" violates not-null constraint
Previous Message Tom Lane 2009-10-10 20:16:30 Re: ERROR: null value in column "id" violates not-null constraint