From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: Euler Taveira <euler.taveira@2ndquadrant.com>
Cc: pgsql-bugs@lists.postgresql.org
Cc: szittya314@gmail.com
Subject: Re: BUG #16386: drop contraint in inherited table is missing in pg_dump backup
Date: Fri, 24 Apr 2020 11:28:39 -0400
Message-ID: <20200424152839.GA28038@alvherre.pgsql> (raw)
In-Reply-To: <CAH503wB4v5DKG1hdjJUeBDzzWmKMFYMJRADmoW6-NfOteedF+w@mail.gmail.com>
On 2020-Apr-24, Euler Taveira wrote:
> On Fri, 24 Apr 2020 at 07:09, PG Bug reporting form <noreply@postgresql.org>
> wrote:
>
> > create table b (aaa int primary key,bb date );
> > create table A (id int primary key) inherits (B);
> > alter table a alter column aaa drop not null;
> >
> > after i made pg_dump and pg_restore the not null contraint isexist on table
> > a;
> >
> It does not make sense to exclude a not null constraint on an inherited
> table because column "aaa" can be null in table "a" but a SELECT in table
> "b" will return a NULL for a primary key (ugh). It is just one of the ways
> to shoot yourself in the foot. If you check CREATE TABLE synopsis, there
> isn't NO INHERIT for not null constraints. Maybe it is worth adding a note
> in CREATE TABLE.
I agree with your analysis, but in that case we should make the DROP NOT
NULL throw an error instead of proceeding.
--
Álvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
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-bugs@postgresql.org
Cc: alvherre@2ndquadrant.com, euler.taveira@2ndquadrant.com, pgsql-bugs@lists.postgresql.org, szittya314@gmail.com
Subject: Re: BUG #16386: drop contraint in inherited table is missing in pg_dump backup
In-Reply-To: <20200424152839.GA28038@alvherre.pgsql>
* 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