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

From: Jan Wieck <jan(at)wi3ck(dot)info>
To: Nikolay Samokhvalov <samokhvalov(at)gmail(dot)com>
Cc: Perry Smith <pedz(at)easesoftware(dot)com>, pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: What have I done!?!?!? :-)
Date: 2022-04-08 12:47:46
Message-ID: 0e4ea8e7-bfe2-b3ce-1edb-baa247bac0ca@wi3ck.info
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 4/8/22 01:57, Nikolay Samokhvalov wrote:
> On Thu, Apr 7, 2022 at 8:10 AM Jan Wieck <jan(at)wi3ck(dot)info
> <mailto:jan(at)wi3ck(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Magnus Hagander 2022-04-08 12:58:16 Re: What have I done!?!?!? :-)
Previous Message Laurenz Albe 2022-04-08 12:26:42 Re: How to get updated order data