Match Full on foreign Key - Mailing list pgsql-general

From sl26@ukc.ac.uk (Marc Richards)
Subject Match Full on foreign Key
Date
Msg-id 8a5911e.0302090926.46a657c2@posting.google.com
Whole thread Raw
List pgsql-general
I have defined the following foreign keys in a table:

*********
FOREIGN KEY (staff_login) REFERENCES staff (staff_login) MATCH FULL ON
DELETE CASCADE ON UPDATE CASCADE,

    FOREIGN KEY (module_code) REFERENCES module (module_code) MATCH FULL
ON DELETE CASCADE ON UPDATE CASCADE,
*********

these two fields make the primary key of the table in which they are
in.

MATCH FULL will not allow one column of a multi-column foreign key to
be NULL unless all foreign key columns are NULL...so:

*If an entry is made in "staff_login" from the "staff" table that it
references, then "module_code" will be empty until the user enters a
value for that field in the "module" table.  Will having MATCH FULL on
*both* keys present problems them when users fill in their details?
Should I just have MATCH FULL on one field or even on none at all and
have my web application (which feeds data into the DB) check this
instead?

Comments appreciated,
Cheers.

pgsql-general by date:

Previous
From: "scott.marlowe"
Date:
Subject: Re: question about managing multiple databases
Next
From: gl_nospam@earthlink.net (Greg Laird)
Date:
Subject: Postgres Windows ADO help needed