Re: 7.1 (current) unwanted NOT NULL constraint inserted - Mailing list pgsql-hackers

From Oliver Elphick
Subject Re: 7.1 (current) unwanted NOT NULL constraint inserted
Date
Msg-id 200012152331.eBFNVfr16539@linda.lfix.co.uk
Whole thread Raw
In response to Re: 7.1 (current) unwanted NOT NULL constraint inserted  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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
inheritedproperly from the parent. >In other words you couldn't say PRIMARY KEY for an inherited column >unless it is
NOTNULL (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'thave 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.Elphick@lfix.co.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 
 




pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: CURRENT/OLD keywords still broken
Next
From: Peter Eisentraut
Date:
Subject: Re: CURRENT/OLD keywords still broken