Re: What have I done!?!?!? :-)

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: What have I done!?!?!? :-)
Дата
Msg-id CAKFQuwY15ik_cjGZMzd_uuiiVYjQUCOedkjQFRJ3xRcm276ptw@mail.gmail.com
обсуждение исходный текст
Ответ на What have I done!?!?!? :-)  (Perry Smith <pedz@easesoftware.com>)
Список pgsql-general
On Wednesday, April 6, 2022, Perry Smith <pedz@easesoftware.com> wrote:

I’m using Active Record with the psql adapter.  It has a disable_referential_integrity which takes a block of code.  When the block of code exists, the constraints are put back.  At least, that is what I thought.

Constraints basically are only ever evaluated when DML (insert, update, delete) commands commit and ensure the rows affected by those commands are valid at that moment in time.  If you manage to insert invalid data, because you say disabled validation, it will not be checked again.  Even an “update” doesn’t re-check the existing record, it effectively deletes it, and then checks its replacement.

So, yes, the constraints were probably “put back”, but it was too late, the invalid data was already saved.

David J.


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

Предыдущее
От: Adrian Klaver
Дата:
Сообщение: Re: Per-Table vacuum_freeze_min_age
Следующее
От: Chris Bisnett
Дата:
Сообщение: Re: Per-Table vacuum_freeze_min_age