public inbox for [email protected]  
help / color / mirror / Atom feed
From: Pavel Luzanov <[email protected]>
To: Dominique Devienne <[email protected]>
To: [email protected]
Subject: Re: DISABLE TRIGGER doc wrong?
Date: Mon, 25 Aug 2025 20:13:50 +0300
Message-ID: <[email protected]> (raw)
In-Reply-To: <CAFCRh--VRAHh2D7PsvW1mgRFfx2bqLQH_8asEBTLBn3RDLT7tA@mail.gmail.com>
References: <CAFCRh--VRAHh2D7PsvW1mgRFfx2bqLQH_8asEBTLBn3RDLT7tA@mail.gmail.com>

On 25.08.2025 19:19, Dominique Devienne wrote:
> Fromhttps://www.postgresql.org/docs/current/sql-altertable.html#SQL-ALTERTABLE-DESC-DISABLE-ENABLE-TRIGGER:
>> Disabling or enabling internally generated constraint triggers requires 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)=# set session authorization alice;
SET
alice@postgres(17.5)=> create table t (id int primary key, parent_id int 
references t(id));
CREATE TABLE
alice@postgres(17.5)=> select tgname from pg_trigger where tgrelid = 
't'::regclass;
              tgname
--------------------------------
  RI_ConstraintTrigger_a_1260370
  RI_ConstraintTrigger_a_1260371
  RI_ConstraintTrigger_c_1260372
  RI_ConstraintTrigger_c_1260373
(4 rows)

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

-- 
Pavel Luzanov
Postgres Professional:https://postgrespro.com


view thread (4+ messages)  latest in thread

reply

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 using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected]
  Subject: Re: DISABLE TRIGGER doc wrong?
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox