Re: feature requests (possibly interested in working on this): functional foreign keys

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: feature requests (possibly interested in working on this): functional foreign keys
Дата
Msg-id 11418.1360249460@sss.pgh.pa.us
обсуждение исходный текст
Ответ на feature requests (possibly interested in working on this): functional foreign keys  (Chris Travers <chris.travers@gmail.com>)
Список pgsql-general
Chris Travers <chris.travers@gmail.com> writes:
> What would be nice to be able to do is to be able to do something like:
> ALTER TABLE inet_assignment ADD FOREIGN KEY (network(inet_address))
> REFERENCES cidr_block(block_def);

> 2.  Are there any other major showstoppers I haven't thought of?

The information_schema can't represent such a thing, and this is
unfixable without breaking the SQL standard.  I suppose we could omit
functional FK constraints from the information_schema views, but that's
not terribly palatable.

Have you considered just storing the network(inet_address) value in a
separate column (maintained by a BEFORE INSERT/UPDATE trigger) and then
using a regular FK with that?

            regards, tom lane

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

Предыдущее
От: Anoop K
Дата:
Сообщение: Re: REINDEX deadlock - Postgresql -9.1
Следующее
От: Russell Keane
Дата:
Сообщение: 64 bit Win 2008, 32 bit client, ?bit Postgres?