Re: ALTER TABLE ... ADD FOREIGN KEY ... NOT ENFORCED

Поиск
Список
Период
Сортировка
От Rob Wultsch
Тема Re: ALTER TABLE ... ADD FOREIGN KEY ... NOT ENFORCED
Дата
Msg-id AANLkTinbciF26yrA-a_vV-fKbqf8=89fTytAfYHsHyCc@mail.gmail.com
обсуждение исходный текст
Ответ на Re: ALTER TABLE ... ADD FOREIGN KEY ... NOT ENFORCED  (Andrew Dunstan <andrew@dunslane.net>)
Ответы Re: ALTER TABLE ... ADD FOREIGN KEY ... NOT ENFORCED  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
On Sun, Dec 12, 2010 at 7:24 PM, Andrew Dunstan <andrew@dunslane.net> wrote:
> In fact it's possible now to disable FK enforcement, by disabling the
> triggers. It's definitely a footgun though. Just the other day I was asked
> how data violating the constraint could have got into the table, and caused
> some surprise by demonstrating how easy this was to produce.

Ugh. I have read the entire pg manual and I did not recall that
footgun.  At least in MySQL disabling fk's is explicit. There is
something to be said for being able to tell the database: "Hey, hold
my beer and watch this, it might be stupid but it is what we are going
to do". The database telling it's user that is a much larger issue
(and yes, MySQL is generally worse). The user at least gets to talk to
db through sql, the database only really gets to talk to the user
through errors and the manual.

The fact that fk checks are implemented by the trigger system somehow
seems "surprising".

-- 
Rob Wultsch
wultsch@gmail.com


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

Предыдущее
От: Glen Knowles
Дата:
Сообщение: Re: [COMMITTERS] pgsql: Use symbolic names not octal constants for file permission flags
Следующее
От: Rob Wultsch
Дата:
Сообщение: Re: unlogged tables