Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ncoeH-00020O-P5 for pgsql-general@arkaria.postgresql.org; Fri, 08 Apr 2022 13:27:37 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ncoeG-00041C-Fg for pgsql-general@arkaria.postgresql.org; Fri, 08 Apr 2022 13:27:36 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ncoeG-000411-4Y for pgsql-general@lists.postgresql.org; Fri, 08 Apr 2022 13:27:36 +0000 Received: from crocodile.elm.relay.mailchannels.net ([23.83.212.45]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ncoeD-0007BY-Ne for pgsql-general@lists.postgresql.org; Fri, 08 Apr 2022 13:27:35 +0000 X-Sender-Id: a2hosting|x-authuser|pedz+easesoftware.com@mi3-ss4.a2hosting.com Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 437DE6C101D; Fri, 8 Apr 2022 13:27:30 +0000 (UTC) Received: from mi3-ss4.a2hosting.com (unknown [127.0.0.6]) (Authenticated sender: a2hosting) by relay.mailchannels.net (Postfix) with ESMTPA id 7BC516C23AB; Fri, 8 Apr 2022 13:27:29 +0000 (UTC) ARC-Seal: i=1; s=arc-2022; d=mailchannels.net; t=1649424449; a=rsa-sha256; cv=none; b=cOeKQYJ5x+vwn8z+rp3w3A502IUsVBGEC42eA6KU4y/GtvSTQhnXO5YIOxvKhttbjLeEj3 V6XmYgYKxGkGI22s08jVgug73LQTfOiVnkIyxt5yW6trIEzURJBA0LRHUgdWGxKe4P4e7i in1Vxq6psT41l6dPi7ItA4wvqHI4nC/LU5oWc3mdE35LV8q/PMMrIb91EsrUZreKLZ/RgM 1eVuVhZu81UrEwIsIhj7hJvVf/qi/yzoQBEwxD2tjg+HHUM5V48Bn6Xn+CtMigjqgkXAoB 03r0SOio5UsjV/4zQnSwwT45NOFq6LR9KJTRzNW/S7Ki0qvdbL5Qkhi6OPdLGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=mailchannels.net; s=arc-2022; t=1649424449; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references:dkim-signature; bh=X7Sw335RehvLVdFed9yBompV9XW8I93DJjXthKlmbDY=; b=DYz7F737jrsODq2PyfrWtmz+qyAuQWR0+6d4KFjK9PX5lfPY7z8835nJLSQwpXFoN+/nXm wpcAlDKoWrbmwgMPtwSKOE8RE8DOzlADHVxzVdadUJLu+w40TafiqRGt3b+oPg5HxPnTkW 7MIshKsq7IJyD0qXLJ9xVwvVLMaNe5S0mS4KwpdT+NgkcAhkBr+WzAgwsP+Fh6qH6EJf6z KkfdNHxbkvMVfB6iZVVIHgzQrAxS84CnsA7bnpbkkBIqTzpGOUzVMU65YH7dAVb3TTwHHF qMQMhTwctCCkNh3yWtgOoQYc4ZWE2D3I2CVYZg/HloLd/eISTIn8rNsvl2K8wQ== ARC-Authentication-Results: i=1; rspamd-68f9d8f9d5-vwz54; auth=pass smtp.auth=a2hosting smtp.mailfrom=pedz@easesoftware.com X-Sender-Id: a2hosting|x-authuser|pedz+easesoftware.com@mi3-ss4.a2hosting.com Received: from mi3-ss4.a2hosting.com (mi3-ss4.a2hosting.com [68.66.200.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384) by 100.124.238.113 (trex/6.7.1); Fri, 08 Apr 2022 13:27:30 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: a2hosting|x-authuser|pedz+easesoftware.com@mi3-ss4.a2hosting.com X-MailChannels-Auth-Id: a2hosting X-Minister-Society: 46b9ca9c44ffcdb3_1649424450059_262170151 X-MC-Loop-Signature: 1649424450059:1620519240 X-MC-Ingress-Time: 1649424450059 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=easesoftware.com; s=default; h=References:To:Cc:In-Reply-To:Date:Subject: Mime-Version:Content-Type:Message-Id:From:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=X7Sw335RehvLVdFed9yBompV9XW8I93DJjXthKlmbDY=; b=QNV6KZcH+LvjVSnVZ259x7WrXO Tta3HVnYGe0hfJnHqTuBRJ3LJ2XfeUCMLjCsDAyTCVJ0vp+nhrr0R/5jDFCC6N9VVmoEMZc20r49i uQomunscjyjr4x+YVu4t+eoiJRK3AqJlhaIRVkba/bCu0Gr2kBMm/iQUttGnlO8N5Wn1AnruAGvfh fzM8t+CR7xH9KVhgniSf4N8T75nOIE2zxhQBfNpFAZ1LAARUCkB5ldV4Uobx97HOwv+q6SddKJKbZ fLSOh/B8VvalzE/wj+M+O+VH/ome6r0VdQ2YnH6KwI8LSiTC9wJ5xmlD2HWrhTqRvkmw+L+3MJwJp YZnb19uw==; Received: from cpe-70-94-128-193.satx.res.rr.com ([70.94.128.193]:49996 helo=smtpclient.apple) by mi3-ss4.a2hosting.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1ncoe8-0000oJ-Co; Fri, 08 Apr 2022 09:27:28 -0400 From: Perry Smith Message-Id: <27CE3919-E28E-4345-BD86-D834890C61C0@easesoftware.com> Content-Type: multipart/signed; boundary="Apple-Mail=_5B5B37E3-5F3F-4208-8318-3E7ADD9F7EB1"; protocol="application/pgp-signature"; micalg=pgp-sha256 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.80.82.1.1\)) Subject: Re: What have I done!?!?!? :-) Date: Fri, 8 Apr 2022 08:27:27 -0500 In-Reply-To: Cc: Jan Wieck , Nikolay Samokhvalov , pgsql-general@lists.postgresql.org To: Magnus Hagander References: <70c17f9b-1e6e-5dc2-ec1b-a60f9000026c@wi3ck.info> <8242bf5f-acad-34f9-57cf-5424192a3e0d@wi3ck.info> X-Mailer: Apple Mail (2.3696.80.82.1.1) X-AuthUser: pedz+easesoftware.com@mi3-ss4.a2hosting.com List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --Apple-Mail=_5B5B37E3-5F3F-4208-8318-3E7ADD9F7EB1 Content-Type: multipart/alternative; boundary="Apple-Mail=_F53244B0-3227-474B-A07A-14B5D613A2EB" --Apple-Mail=_F53244B0-3227-474B-A07A-14B5D613A2EB Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Apr 8, 2022, at 08:10, Magnus Hagander wrote: >=20 >=20 >=20 > On Fri, Apr 8, 2022 at 3:07 PM Jan Wieck > 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. >=20 > 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). >=20 > 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=E2=80=99= m sure their test user has super user privileges as well. I bet they = don=E2=80=99t 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=E2=80=99ve never seen this discussed. I=E2=80=99m not hugely active = in the Rails community. They never liked me (or perhaps that was = projection on my part). --Apple-Mail=_F53244B0-3227-474B-A07A-14B5D613A2EB Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8

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> 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=E2=80=99m sure their test user has super user privileges as well. =  I bet they don=E2=80=99t 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=E2=80=99ve never seen this discussed.  I=E2=80= =99m not hugely active in the Rails community.  They never liked me = (or perhaps that was projection on my part).

= --Apple-Mail=_F53244B0-3227-474B-A07A-14B5D613A2EB-- --Apple-Mail=_5B5B37E3-5F3F-4208-8318-3E7ADD9F7EB1 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEE5yOa/gCtQpb3oCpljxzk9yzE+MAFAmJQOD8ACgkQjxzk9yzE +MBHog/9FHPoB7VA116Kix0hKjcHG6Y3/ecMi/B6U3qf79gNcAEfsg5j3H6kXIsv 2MOgYHwu/+BIWJxHcFax0j38v2z6oV6FOS6Blx9iM66vv8ZAANBmYmp04Ul1CDy4 M44oenFxmosPOq//0LnwEmGda7NbxJnapLSfRP+H50KCNArDqTdOOzYIK6jy1fwD 7QAampPFh3Q7nAgq2fXIQy5DjGfN+LSjjjOcGkvVB1Mqcg8ll9XCFEt9Gjyxh6AN 1qbmes0d7g6kVGsAMbjDiL0a4VvuCtK54DXUT8xwSIlWdWDT5vjhfuTm4qp3LLO8 1RY09U4J/ZSssgiPa9MCocbojnxm1bdrnM6OQK03a/Y7H9Ht+i0PpRIpc7tkwjqt 5m36CKNqdR5Kv1Zprt9eTTWF0qfPjnQvYM/24AW9zqvYk/gwI3XkkaUY5anwShBM 9HYTPmivNnFTEgglki1cKtMW6h9JeuprPe7/AxSnHX0RU+HDa9sEU/eiiO8gJbvt KeHzb1AD/7z4Aq4Aw1M32L/NM5MdBF3CHg0ygpBUDQrqQrvqT76f4AyNVAOeY8Fm kDMprG+Jhh7M38/OYaZFWRAmaGlwOlo9DeEVSltFwGj26PbEgDkMLC5vaqe5Hdj6 bH7xJUggQA3Be/iHFaeFY7Oeq12rCzyU2eN85zXjE5cDyfh/ELE= =R7sO -----END PGP SIGNATURE----- --Apple-Mail=_5B5B37E3-5F3F-4208-8318-3E7ADD9F7EB1--