Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uqamX-009CPa-Bk for pgsql-general@arkaria.postgresql.org; Mon, 25 Aug 2025 17:14:58 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1uqalY-00Busw-Ni for pgsql-general@arkaria.postgresql.org; Mon, 25 Aug 2025 17:13:57 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uqalY-00Bupo-Cx for pgsql-general@lists.postgresql.org; Mon, 25 Aug 2025 17:13:57 +0000 Received: from mail.postgrespro.ru ([93.174.132.70]) by makus.postgresql.org with smtp (Exim 4.96) (envelope-from ) id 1uqalV-001hEo-1D for pgsql-general@lists.postgresql.org; Mon, 25 Aug 2025 17:13:56 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=postgrespro.ru; s=mx2023; t=1756142030; bh=BUYo9GNZYAcbbJhoyiu/McGLFMeeytS8ZSoiji2j97A=; h=Message-ID:Date:User-Agent:Subject:To:References:From:In-Reply-To: From; b=Ninr3XdlFrdxXIcm3YnnRg67GPAYUl3vLr9Bx6tAnnBfr+qvPYIuIfZ1S18+esJHE X8w3N53MfzhvAvgYeuGjLqIt+65S18rhzpoFGT+tZ61papravAmvscnFW/NcYzSsza svSbjDV+1fcgTwzMOKi/uNcQiAic3vUAidOPeWAkcg8zHSFetQxTx289jA0NVUGmEw JbcZlOhwHtp/DUyXCjbs+dvDf+hvR5e5/rvGRFEnEXqX0IDIcOeFsOJI9u4sKnOLsO g1A/yI3FZXU89IiaM0k2EPljNPO6f9/EhrP35PzOemxraOiEPehrlVioKXEgxl4WYg 5yQQaA2bu8BXw== Received: from [192.168.0.101] (unknown [62.217.184.234]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: p.luzanov@postgrespro.ru) by mail.postgrespro.ru (Postfix/465) with ESMTPSA id 806FE60676; Mon, 25 Aug 2025 20:13:50 +0300 (MSK) Content-Type: multipart/alternative; boundary="------------GGbUi6maJlbjzcvt4WLECRSJ" Message-ID: <185dd861-4e5a-47c0-9f2e-84dfa8a406ca@postgrespro.ru> Date: Mon, 25 Aug 2025 20:13:50 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: DISABLE TRIGGER doc wrong? To: Dominique Devienne , pgsql-general@lists.postgresql.org References: Content-Language: en-US, ru From: Pavel Luzanov In-Reply-To: X-KSMG-AntiPhishing: NotDetected, bases: 2025/08/25 17:02:00 X-KSMG-AntiSpam-Interceptor-Info: not scanned X-KSMG-AntiSpam-Status: not scanned, disabled by settings X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 2.1.0.7854, bases: 2025/08/25 15:06:00 #27693138 X-KSMG-AntiVirus-Status: NotDetected, skipped X-KSMG-LinksScanning: not scanned, disabled by settings X-KSMG-Message-Action: skipped X-KSMG-Rule-ID: 1 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --------------GGbUi6maJlbjzcvt4WLECRSJ Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable On 25.08.2025 19:19, Dominique Devienne wrote: > Fromhttps://www.postgresql.org/docs/current/sql-altertable.html#SQL-ALT= ERTABLE-DESC-DISABLE-ENABLE-TRIGGER: >> Disabling or enabling internally generated constraint triggers require= s superuser privileges > We were disabling triggers as the owner of the table just fine, no > SUPERUSER involved. So is the doc out-of-date? Simple experiment shows that it is still up to date: postgres@postgres(17.5)=3D# set session authorization alice; SET alice@postgres(17.5)=3D> create table t (id int primary key, parent_id in= t=20 references t(id)); CREATE TABLE alice@postgres(17.5)=3D> select tgname from pg_trigger where tgrelid =3D=20 't'::regclass; =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= tgname -------------------------------- =C2=A0RI_ConstraintTrigger_a_1260370 =C2=A0RI_ConstraintTrigger_a_1260371 =C2=A0RI_ConstraintTrigger_c_1260372 =C2=A0RI_ConstraintTrigger_c_1260373 (4 rows) alice@postgres(17.5)=3D> alter table t disable trigger=20 "RI_ConstraintTrigger_a_1260370"; ERROR:=C2=A0 permission denied: "RI_ConstraintTrigger_a_1260370" is a sys= tem=20 trigger alice@postgres(17.5)=3D> \c - postgres You are now connected to database "postgres" as user "postgres". postgres@postgres(17.5)=3D# alter table t disable trigger=20 "RI_ConstraintTrigger_a_1260370"; ALTER TABLE --=20 Pavel Luzanov Postgres Professional:https://postgrespro.com --------------GGbUi6maJlbjzcvt4WLECRSJ Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
On 25.08.2025 19:19, Dominique Devienn= e wrote:
From https://www.postgresql.org/docs/current/sq=
l-altertable.html#SQL-ALTERTABLE-DESC-DISABLE-ENABLE-TRIGGER:
Disabling or enabling internally generated =
constraint triggers requires superuser privileges
We were disabli=
ng triggers as the owner of the table just fine, no
SUPERUSER involved. So is the doc out-of-date?
Simple experiment shows that it is still up to date:

postgres@postgres(17.5)=3D# set session authorization alice;
SET
alice@postgres(17.5)=3D> create table t (id int primary key, parent_id int references t(id));
CREATE TABLE
alice@postgres(17.5)=3D> select tgname from pg_trigger where tgrelid =3D 't'::regclass;
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 tgname=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 =C2=A0
--------------------------------
=C2=A0RI_ConstraintTrigger_a_1260370
=C2=A0RI_ConstraintTrigger_a_1260371
=C2=A0RI_ConstraintTrigger_c_1260372
=C2=A0RI_ConstraintTrigger_c_1260373
(4 rows)

alice@postgres(17.5)=3D> alter table t disable trigger "RI_ConstraintTrigger_a_1260370";
ERROR:=C2=A0 permission denied: "RI_ConstraintTrigger_a_1260370" is a system trigger
alice@postgres(17.5)=3D> \c - postgres
You are now connected to database "postgres" as user "postgres".
postgres@postgres(17.5)=3D# alter table t disable trigger "RI_ConstraintTrigger_a_1260370";
ALTER TABLE

--=20
Pavel Luzanov
Postgres Professional: https://postgrespro.com
--------------GGbUi6maJlbjzcvt4WLECRSJ--