Hello again patchers,

Here is a proposed patch against 7.4.1 to check exact match
of foreign key types wrt the referenced keys, and to show
a warning if this is not the case.

This is an attempt to prevent stupid bugs such as :

  CREATE TABLE foo(id INT4 NOT NULL PRIMARY KEY);
  CREATE TABLE bla(id INT2 REFERENCES foo);

which may work at the beginning, and then fails later on.

I'm not at ease with postgresql internals, however this
implementation seems reasonnable to me, and in the spirit
of how the surrounding code works.

I could not find any simple way to tell the user about
what is being processed, as there is not real context information
and tell 'while processing this constraint'... However this
situation seems to be the normal case with any postgresql
messages, as far as I can tell from my use.

Have a nice day,

-- 
Fabien Coelho - [EMAIL PROTECTED]

Attachment: fk_type_check.diff.gz
Description: Binary data

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
      subscribe-nomail command to [EMAIL PROTECTED] so that your
      message can get through to the mailing list cleanly

Reply via email to