From: Tom Lane <tgl@sss.pgh.pa.us>
To: Robert Paulsen <robert@paulsenonline.net>
Cc: pgsql-sql@postgresql.org
Subject: Re: ERROR: null value in column "id" violates not-null constraint
Date: Sat, 10 Oct 2009 14:46:45 -0400
Message-ID: <17323.1255200405@sss.pgh.pa.us> (raw)
In-Reply-To: <200910101056.24051.robert@paulsenonline.net>
References: <200910101056.24051.robert@paulsenonline.net>
Robert Paulsen <robert@paulsenonline.net> writes:
> I have a database with a sequence field as a primary key in a table and can no
> longer insert data into it as it gets the subject error message.
Does the table actually have a default for id anymore? (Try looking
at it with psql's \d command.)
> POSSIBLE REASON FOR THE PROBLEM:
> I dumped the data, restored it into postgresql-8.2.13-0.1. dumped it from
> there and restored it back to postgresql-server-8.0.13-1.1. I now get the
> same failure from both 8.0 and 8.2.
pg_dump does not guarantee to produce backward-transportable dumps.
Did you pay attention to whether you got any errors while loading the
8.2 dump into 8.0? I don't have time to test it right now, but what
I'm thinking is that an ALTER TABLE ADD DEFAULT type of command failed
during the load because of some syntax issue or other.
Another possible foot-gun is to have tried to dump from the 8.2 server
using 8.0 pg_dump. This will generally not work; pg_dump cannot be
expected to understand system catalog layouts that are newer than it
is. You can force it to try with the -i switch, but usually that
doesn't result in anything better than a busted dump.
regards, tom lane
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: tgl@sss.pgh.pa.us, robert@paulsenonline.net
Subject: Re: ERROR: null value in column "id" violates not-null constraint
In-Reply-To: <17323.1255200405@sss.pgh.pa.us>
* 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