BUG #16772: Options --disable-triggers in combination with --superuser does not have the expected result - Mailing list pgsql-bugs

From PG Bug reporting form
Subject BUG #16772: Options --disable-triggers in combination with --superuser does not have the expected result
Date
Msg-id 16772-3c85d0bb913fa9e8@postgresql.org
Whole thread Raw
Responses Re: BUG #16772: Options --disable-triggers in combination with --superuser does not have the expected result
List pgsql-bugs
The following bug has been logged on the website:

Bug reference:      16772
Logged by:          Edwin Polkerman
Email address:      edwin.polkerman@splendiddata.com
PostgreSQL version: 13.1
Operating system:   CentOS 7.8.2003 (x86_64)
Description:

Trying to create a dump with following command line:

   pg_dumpall -h <database host> -p 5432 -U user1 -f /tmp/dump.out
--disable-triggers -S user2 -v

User1 is a regular user and user2 is a superuser like the documentation
states: "Specify the superuser user name to use when disabling triggers"

Expected result:
The dump will complete without error's

Observed result:
Directly after starting the command following error is shown:

pg_dumpall: executing SELECT pg_catalog.set_config('search_path', '',
false);
pg_dumpall: executing SELECT oid, rolname, rolsuper, rolinherit,
rolcreaterole, rolcreatedb, rolcanlogin, rolconnlimit, rolpassword,
rolvaliduntil, rolreplication, rolbypassrls,
pg_catalog.shobj_description(oid, 'pg_authid') as rolcomment, rolname =
current_user AS is_current_user FROM pg_authid WHERE rolname !~ '^pg_' ORDER
BY 2
pg_dumpall: error: query failed: ERROR:  permission denied for table
pg_authid
pg_dumpall: error: query was: SELECT oid, rolname, rolsuper, rolinherit,
rolcreaterole, rolcreatedb, rolcanlogin, rolconnlimit, rolpassword,
rolvaliduntil, rolreplication, rolbypassrls,
pg_catalog.shobj_description(oid, 'pg_authid') as rolcomment, rolname =
current_user AS is_current_user FROM pg_authid WHERE rolname !~ '^pg_' ORDER
BY 2

Although a superuser is provided with -S, it looks like this is not used but
it uses the user (user1) making the connection in the connection string.

Running the command as superuser (-U user2) and omitting -S works as
expected


pgsql-bugs by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: BUG #16767: Silent dropping of CONSTRAINT... UNIQUE
Next
From: Tom Lane
Date:
Subject: Re: BUG #16772: Options --disable-triggers in combination with --superuser does not have the expected result