Re: 7.1 (current) unwanted NOT NULL constraint inserted

From: "Oliver Elphick" <olly(at)lfix(dot)co(dot)uk>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: 7.1 (current) unwanted NOT NULL constraint inserted
Date: 2000-12-15 23:31:41
Message-ID: 200012152331.eBFNVfr16539@linda.lfix.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:
...
>Short of a major restructuring of inherited-column creation, I see
>no good solution to this. I see two bad solutions:
>
>1. Require that the referenced column be marked NOT NULL already,
>so that the constraint will be inherited properly from the parent.
>In other words you couldn't say PRIMARY KEY for an inherited column
>unless it is NOT NULL (or a fortiori, PRIMARY KEY) in the parent table.
>
>2. Do nothing, in effect silently dropping the NOT NULL constraint
>for such a column. (Actually we don't have to be silent about it;
>we could emit a NOTICE when the parent doesn't have NOT NULL.)
>
>IMHO, #1 is a little less bad, but I'm not firmly committed to it.
>Comments anyone?

In the absence of properly working inheritance, I would vote for 1. (I
am only declaring PRIMARY KEY on the inherited column because that
constraint doesn't get inherited as (I think) it should.) Option 2 would
give a wrongly-defined table.

--
Oliver Elphick Oliver(dot)Elphick(at)lfix(dot)co(dot)uk
Isle of Wight http://www.lfix.co.uk/oliver
PGP: 1024R/32B8FAA1: 97 EA 1D 47 72 3F 28 47 6B 7E 39 CC 56 E4 C1 47
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839 932A 614D 4C34 3E1D 0C1C
========================================
"The fear of the LORD is the instruction of wisdom, and
before honour is humility." Proverbs 15:33

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2000-12-15 23:36:32 Re: CURRENT/OLD keywords still broken
Previous Message Tom Lane 2000-12-15 23:15:07 Re: CURRENT/OLD keywords still broken