Re: Re: starting to review the Extend NOT NULL representation to pg_constraint patch - Mailing list pgsql-hackers

From Robert Haas
Subject Re: Re: starting to review the Extend NOT NULL representation to pg_constraint patch
Date
Msg-id BANLkTikd5DpCPYfE5ey__ZXQ6EGZ_FNgyw@mail.gmail.com
Whole thread Raw
In response to Re: Re: starting to review the Extend NOT NULL representation to pg_constraint patch  (Alvaro Herrera <alvherre@commandprompt.com>)
Responses Re: Re: starting to review the Extend NOT NULL representation to pg_constraint patch
List pgsql-hackers
On Fri, Jun 24, 2011 at 6:39 PM, Alvaro Herrera
<alvherre@commandprompt.com> wrote:
> So remind me ... did we discuss PRIMARY KEY constraints?  Are they
> supposed to show up as inherited not null rows in the child?  Obviously,
> they do not show up as PKs in the child, but they *are* not null so my
> guess is that they need to be inherited as not null as well.  (Right
> now, unpatched head of course emits the column as attnotnull).
>
> In this case, the inherited name (assuming that the child declaration
> does not explicitely state a constraint name) should be the same as the
> PK, correct?

I would tend to think of the not-null-ness that is required by the
primary constraint as a separate constraint, not an intrinsic part of
the primary key.  IOW, if you drop the primary key constraint, IMV,
that should never cause the column to begin allowing nulls.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: Re: starting to review the Extend NOT NULL representation to pg_constraint patch
Next
From: David Christensen
Date:
Subject: Re: Deriving release notes from git commit messages