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 any purpose 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 not allow one column of a 
multicolumn foreign key to be null unless all foreign key columns are null. 
MATCH SIMPLE allows some 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 the site, 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!



-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Reply via email to