pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bruce Momjian <bruce@momjian.us>
To: Bruce Momjian <bruce@momjian.us>
Cc: Bernhard Rohrer <graylion@sm-wg.net>
Cc: Bernhard Schrader <bernhard.schrader@innogames.de>
Cc: pgsql-admin@postgresql.org
Subject: Re: PG_update to 9.0.4 in ubuntu lucid 64
Date: Wed, 23 Feb 2011 18:37:40 -0500 (EST)
Message-ID: <201102232337.p1NNbfc05564@momjian.us> (raw)
In-Reply-To: <201102232322.p1NNMPD02922@momjian.us>

Bruce Momjian wrote:
> Bernhard Rohrer wrote:
> >  Thanks that worked. :)
> > 
> > After this and some more entertainment we are now here:
> > 
> > Restoring database schema to new cluster
> > psql:/usr/lib/postgresql/9.0/bin/pg_upgrade_dump_db.sql:24606: ERROR:
> > column "name" in child table must be marked NOT NULL
> > 
> > 
> > There were problems executing "/usr/lib/postgresql/9.0/bin/psql" --set
> > ON_ERROR_STOP=on --no-psqlrc --port 5432 --username "postgres" -f
> > "/usr/lib/postgresql/9.0/bin/pg_upgrade_dump_db.sql" --dbname template1
> > >> "/dev/null"
> > 
> > 
> > does that mean line24606? it looks like manual edititng required ...
> 
> I checked the source code and the check it is failing on has this comment:
> 
> /*
>  * Check columns in child table match up with columns in parent, and increment
>  * their attinhcount.
>  *
>  * Called by ATExecAddInherit
>  *
>  * Currently all parent columns must be found in child. Missing columns are an
>  * error.  One day we might consider creating new columns like CREATE TABLE
>  * does.  However, that is widely unpopular --- in the common use case of
>  * partitioned tables it's a foot-gun.
>  *
>  * The data type must match exactly. If the parent column is NOT NULL then
>  * the child must be as well. Defaults are not compared, however.
>  */
>  MergeAttributesIntoExisting() 
> 
> It seems somehow your schema is corrupt --- it is pg_dump that is
> failing, and threfore pg_upgrade.  We need to find out how you got into
> that state.  Do a manual pg_dump and see what table is being referenced
> on line 24606.  It is saying that that table has a 'name' column that is
> not marked NOT NULL, while the parent table does have a NOT NULL
> specification.  Those should match.  I don't remember hearing about a
> bug in that area of the code.

FYI, you can easily reproduce the failure by trying to restore a pg_dump
--schema dump into an empty database.

-- 
  Bruce Momjian  <bruce@momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + It's impossible for everything to be true. +



view thread (14+ messages)  latest in thread

Message-ID: <201102232337.p1NNbfc05564@momjian.us>
Permalink:  ../201102232337.p1NNbfc05564@momjian.us/
Also on:    postgresql.org/message-id/201102232337.p1NNbfc05564@momjian.us

 · 

reply

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-admin@postgresql.org
  Cc: bruce@momjian.us, graylion@sm-wg.net, bernhard.schrader@innogames.de
  Subject: Re: PG_update to 9.0.4 in ubuntu lucid 64
  In-Reply-To: <201102232337.p1NNbfc05564@momjian.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