Foreign key type checking patch

Поиск
Список
Период
Сортировка
От Fabien COELHO
Тема Foreign key type checking patch
Дата
Msg-id Pine.LNX.4.58.0403011634110.28778@sablons.cri.ensmp.fr
обсуждение исходный текст
Ответы Re: Foreign key type checking patch  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-patches
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 - coelho@cri.ensmp.fr

Вложения

В списке pgsql-patches по дате отправления:

Предыдущее
От: Fabien COELHO
Дата:
Сообщение: "ALSO" keyword to "CREATE RULE" patch
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Foreign key type checking patch