Search Postgresql Archives

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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wednesday, April 6, 2022, Perry Smith <pedz@xxxxxxxxxxxxxxxx> 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.



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux