Referential Integrity.

Поиск
Список
Период
Сортировка
От Wm. G. Urquhart
Тема Referential Integrity.
Дата
Msg-id Pine.LNX.4.44.0205201243330.13618-100000@mailer.wurquhart.co.uk
обсуждение исходный текст
Ответы Re: Referential Integrity.  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
Список pgsql-general
Hi All,

After yesterday's disaster I've taken this opportunity to rebuild by
database from the ground up. As part of this I want to be able to set a
column to have a default of 0 (easy enough) but this column is a Foreign
Key to another table whos referenced column value starts at 1.

Is there anyway I can write a FK Constraint that will allow this? I don't
want to have to enter a row in the referenced table since since it in turn
has not null constraints on it.

I really want a way to allow 0 as a legitimate value, to assist in the
predicates of a SELECT. It is possible to get to and modify the code that
PostgreSQL creates to enforce this I assume via CREATE CONSTRAINT TRIGGER?

Any help would be appreciated.

--
Regards,


Wm. G. Urquhart
Custom Software Solutions
http://www.wurquhart.co.uk



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

Предыдущее
От: Joseph Maxwell
Дата:
Сообщение: Is Digest Mode Really Available?
Следующее
От: "Wm. G. Urquhart"
Дата:
Сообщение: Further thoughts on Referential Integrity