pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: m.winkel@w2solutions.nl
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #11381: Inherited NOT NULL to NULLABLE column: backup restore error.
Date: Mon, 08 Sep 2014 11:47:59 -0400
Message-ID: <2680.1410191279@sss.pgh.pa.us> (raw)
In-Reply-To: <20140908144913.2936.63756@wrigleys.postgresql.org>
References: <20140908144913.2936.63756@wrigleys.postgresql.org>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

m.winkel@w2solutions.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


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



view thread (2+ messages)

Message-ID: <2680.1410191279@sss.pgh.pa.us>
Permalink:  ../2680.1410191279@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/2680.1410191279@sss.pgh.pa.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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, m.winkel@w2solutions.nl
  Subject: Re: BUG #11381: Inherited NOT NULL to NULLABLE column: backup restore error.
  In-Reply-To: <2680.1410191279@sss.pgh.pa.us>
  References: <20140908144913.2936.63756@wrigleys.postgresql.org> <2680.1410191279@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