Re: BUG #11381: Inherited NOT NULL to NULLABLE column: backup restore error.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: m(dot)winkel(at)w2solutions(dot)nl
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #11381: Inherited NOT NULL to NULLABLE column: backup restore error.
Date: 2014-09-08 15:47:59
Message-ID: 2680.1410191279@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

m(dot)winkel(at)w2solutions(dot)nl writes:
> CREATE TABLE base
> (
> id serial NOT NULL,
> name character varying(127) NOT NULL,
> nickname character varying(127) NOT NULL,
> email_address character varying(512) NOT NULL,
> useless_but_required_field text NOT NULL,
> CONSTRAINT base_pkey PRIMARY KEY (id)
> )
> WITH (
> OIDS=FALSE
> );

> CREATE TABLE inherited
> (
> CONSTRAINT inherited_pkey PRIMARY KEY (id)
> )
> INHERITS (base)
> WITH (
> OIDS=FALSE
> );

> ALTER TABLE inherited
> ALTER COLUMN useless_but_required_field DROP NOT NULL;

IMO this should definitely be disallowed. But we lack the catalog
infrastructure to do so conveniently. There has been some work
towards representing NOT NULL constraints more like CHECK constraints,
which do have the required infrastructure. Once that's finished,
you'll probably see this be rejected. There's not much point in
trying to make pg_dump cope with it, I think.

regards, tom lane

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Peter Eisentraut 2014-09-09 18:09:50 Re: BUG #10528: MAC OS X was renamed
Previous Message m.winkel 2014-09-08 14:49:13 BUG #11381: Inherited NOT NULL to NULLABLE column: backup restore error.