From: Perry Smith <pedz@easesoftware.com>
To: Magnus Hagander <magnus@hagander.net>
Cc: Jan Wieck <jan@wi3ck.info>
Cc: Nikolay Samokhvalov <samokhvalov@gmail.com>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: What have I done!?!?!? :-)
Date: Fri, 8 Apr 2022 08:27:27 -0500
Message-ID: <27CE3919-E28E-4345-BD86-D834890C61C0@easesoftware.com> (raw)
In-Reply-To: <CABUevEwdXwUZtDBE-fPCsNoHstcvzaFdNwAiVim2jU0WgsAuPw@mail.gmail.com>
References: <E2D1EB02-6391-4698-B703-3B02E5271FBC@easesoftware.com>
<70c17f9b-1e6e-5dc2-ec1b-a60f9000026c@wi3ck.info>
<CANNMO+J-KZggPz4pX=KUOfRwpXm=Qo3eXz9=e2BtdnaBZbZRqg@mail.gmail.com>
<CABUevEx22cC2xOTuEG_hiWq3Ed3eZvuFb=CUxtFdP8cmUKuvZA@mail.gmail.com>
<8242bf5f-acad-34f9-57cf-5424192a3e0d@wi3ck.info>
<CABUevEwdXwUZtDBE-fPCsNoHstcvzaFdNwAiVim2jU0WgsAuPw@mail.gmail.com>
> On Apr 8, 2022, at 08:10, Magnus Hagander <magnus@hagander.net> wrote:
>
>
>
> On Fri, Apr 8, 2022 at 3:07 PM Jan Wieck <jan@wi3ck.info <mailto:jan@wi3ck.info>> wrote:
> On 4/8/22 08:58, Magnus Hagander wrote:
> > A side-note on this, which of course won't help the OP at this point,
> > but if the general best practice of not running the application with a
> > highly privileged account is followed, the problem won't occur (it will
> > just fail early before breaking things). DISABLE TRIGGER ALL requires
> > either ownership of the table or superuser permissions, none of which
> > it's recommended that the application run with. Doesn't help once the
> > problem has occurred of course, but can help avoid it happening in the
> > future.
>
> It gets even better further down in that code, where it UPDATEs
> pg_constraint directly. That not only requires superuser but also catupd
> permissions (which are separate from superuser for a reason).
>
> Indeed.The fact that's in the code is sadly an indicator of how many people run their app as superuser :(
Interesting conversation. Yes, the developer generally has superuser DB because they need to create the DB, etc. And, during testing, I’m sure their test user has super user privileges as well. I bet they don’t set up the DB with one user and then test with a non-SU user during test and the corollary is I bet the DB user used in production is also a super user in the majority of the installations. I’ve never seen this discussed. I’m not hugely active in the Rails community. They never liked me (or perhaps that was projection on my part).
Attachments:
signature.asc (application/pgp-signature, 832B) download
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: pedz@easesoftware.com, magnus@hagander.net, jan@wi3ck.info, samokhvalov@gmail.com
Subject: Re: What have I done!?!?!? :-)
In-Reply-To: <27CE3919-E28E-4345-BD86-D834890C61C0@easesoftware.com>
References: <E2D1EB02-6391-4698-B703-3B02E5271FBC@easesoftware.com> <70c17f9b-1e6e-5dc2-ec1b-a60f9000026c@wi3ck.info> <CANNMO+J-KZggPz4pX=KUOfRwpXm=Qo3eXz9=e2BtdnaBZbZRqg@mail.gmail.com> <CABUevEx22cC2xOTuEG_hiWq3Ed3eZvuFb=CUxtFdP8cmUKuvZA@mail.gmail.com> <8242bf5f-acad-34f9-57cf-5424192a3e0d@wi3ck.info> <CABUevEwdXwUZtDBE-fPCsNoHstcvzaFdNwAiVim2jU0WgsAuPw@mail.gmail.com> <27CE3919-E28E-4345-BD86-D834890C61C0@easesoftware.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox