Re: DISABLE TRIGGER doc wrong?

Pavel Luzanov <p.luzanov@postgrespro.ru>

From: Pavel Luzanov <p.luzanov@postgrespro.ru>
To: Dominique Devienne <ddevienne@gmail.com>, pgsql-general@lists.postgresql.org
Date: 2025-08-25T17:13:50Z
Lists: pgsql-general
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