Re: What have I done!?!?!? :-) - Mailing list pgsql-general

From Jan Wieck
Subject Re: What have I done!?!?!? :-)
Date
Msg-id 0e4ea8e7-bfe2-b3ce-1edb-baa247bac0ca@wi3ck.info
Whole thread Raw
In response to Re: What have I done!?!?!? :-)  (Nikolay Samokhvalov <samokhvalov@gmail.com>)
Responses Re: What have I done!?!?!? :-)  (Perry Smith <pedz@easesoftware.com>)
List pgsql-general
On 4/8/22 01:57, Nikolay Samokhvalov wrote:
> On Thu, Apr 7, 2022 at 8:10 AM Jan Wieck <jan@wi3ck.info 
> <mailto:jan@wi3ck.info>> wrote:
> 
>     So **IF** Active Record is using that feature, then it can dump any
>     amount of garbage into your PostgreSQL database and PostgreSQL will
>     happily accept it with zero integrity checking.
> 
> 
> It's DISABLE TRIGGER ALL 
>
https://github.com/rails/rails/blob/831031a8cec5bfe59ef653ae2857d4fe64c5698d/activerecord/lib/active_record/connection_adapters/postgresql/referential_integrity.rb#L12

>
<https://github.com/rails/rails/blob/831031a8cec5bfe59ef653ae2857d4fe64c5698d/activerecord/lib/active_record/connection_adapters/postgresql/referential_integrity.rb#L12>

Similar poison, same side effect.

Looking further at that code it also directly updates the PostgreSQL 
system catalog. This is a big, red flag.

Why do the Rails developers think they need a sledgehammer like that? It 
seems to be doing that for over 7 years, so it is hard to tell from the 
commit log why they need to disable RI at all.


Regards, Jan



pgsql-general by date:

Previous
From: Laurenz Albe
Date:
Subject: Re: How to get updated order data
Next
From: Magnus Hagander
Date:
Subject: Re: What have I done!?!?!? :-)