MATCH FULL (Was: Re: Adding Foreign Key Constraint To Existing Table) - Mailing list pgsql-general

From Alban Hertroys
Subject MATCH FULL (Was: Re: Adding Foreign Key Constraint To Existing Table)
Date
Msg-id D8055F2A-21AF-4A9A-88C5-7BDCC375F707@solfertje.student.utwente.nl
Whole thread Raw
In response to Re: Adding Foreign Key Constraint To Existing Table  (Adrian Klaver <adrian.klaver@gmail.com>)
List pgsql-general
On 1 Jul 2011, at 23:10, Adrian Klaver wrote:

> http://www.postgresql.org/docs/9.0/interactive/sql-altertable.html
> Examples at bottom of page:
> "To add a foreign key constraint to a table:
> ALTER TABLE distributors ADD CONSTRAINT distfk FOREIGN KEY (address) REFERENCES addresses (address) MATCH FULL;
> "

Ah, so that's where my habit to add MATCH FULL to every FK constraint originated from! I'm pretty sure it doesn't serve
anypurpose in the above single-column constraint, or does it? 

The docs say about MATCH:
"There are three match types: MATCH FULL, MATCH PARTIAL, and MATCH SIMPLE, which is also the default. MATCH FULL will
notallow one column of a multicolumn foreign key to be null unless all foreign key columns are null. MATCH SIMPLE
allowssome foreign key columns to be null while other parts of the foreign key are not null. MATCH PARTIAL is not yet
implemented."

Perhaps this warrants a documentation patch? It goes at least as far back as 8.2, the oldest online documentation on
thesite, maybe even as far back as 7.4 (the first version I used) or earlier. 

Alban Hertroys

--
If you can't see the forest for the trees,
cut the trees and you'll see there is no forest.


!DSPAM:737,4e0ef3b012091559666998!



pgsql-general by date:

Previous
From: Thom Brown
Date:
Subject: Re: include directives in postgresql.conf
Next
From: Geoffrey Myers
Date:
Subject: out of memory error