From: Robert Paulsen <robert@paulsenonline.net>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-sql@postgresql.org
Subject: Re: ERROR: null value in column "id" violates not-null constraint
Date: Sat, 10 Oct 2009 15:29:15 -0500
Message-ID: <200910101529.15690.robert@paulsenonline.net> (raw)
In-Reply-To: <20765.1255205790@sss.pgh.pa.us>
References: <200910101056.24051.robert@paulsenonline.net>
<200910101405.26853.robert@paulsenonline.net>
<20765.1255205790@sss.pgh.pa.us>
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 back
id integer DEFAULT nextval('vault_id_seq'::text) NOT NULL,
That "text" seems odd. Should I change it?
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: robert@paulsenonline.net, tgl@sss.pgh.pa.us
Subject: Re: ERROR: null value in column "id" violates not-null constraint
In-Reply-To: <200910101529.15690.robert@paulsenonline.net>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox