password_required2.log

text/x-log

Filename: password_required2.log
Type: text/x-log
Part: 2
Message: Questions about the new subscription parameter: password_required
--
\c tests_pg16 postgres
You are now connected to database "tests_pg16" as user "postgres".
--
SELECT version();
                                                 version                                                  
----------------------------------------------------------------------------------------------------------
 PostgreSQL 16.0 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 12.3.1 20230508 (Red Hat 12.3.1-1), 64-bit
(1 row)

--
CREATE SUBSCRIPTION sub_pg16   
       CONNECTION 'host=/var/run/postgresql port=5437 user=user_pub_pg16 dbname=tests_pg16'
       PUBLICATION pub_pg16;
psql:/home/benoit/tmp/password_required2.sql:8: NOTICE:  created replication slot "sub_pg16" on publisher
CREATE SUBSCRIPTION
--
ALTER SUBSCRIPTION sub_pg16 OWNER TO sub_owner ;
ALTER SUBSCRIPTION
--
\x
Expanded display is on.
\dRs+
List of subscriptions
-[ RECORD 1 ]------+------------------------------------------------------------------------
Name               | sub_pg16
Owner              | sub_owner
Enabled            | t
Publication        | {pub_pg16}
Binary             | f
Streaming          | off
Two-phase commit   | d
Disable on error   | f
Origin             | any
Password required  | t
Run as owner?      | f
Synchronous commit | off
Conninfo           | host=/var/run/postgresql port=5437 user=user_pub_pg16 dbname=tests_pg16
Skip LSN           | 0/0

\du+
List of roles
-[ RECORD 1 ]-----------------------------------------------------------
Role name   | postgres
Attributes  | Superuser, Create role, Create DB, Replication, Bypass RLS
Description | 
-[ RECORD 2 ]-----------------------------------------------------------
Role name   | sub_owner
Attributes  | 
Description | 

\l tests_pg16
List of databases
-[ RECORD 1 ]-----+----------------------
Name              | tests_pg16
Owner             | postgres
Encoding          | UTF8
Locale Provider   | libc
Collate           | C
Ctype             | C
ICU Locale        | 
ICU Rules         | 
Access privileges | =Tc/postgres         +
                  | postgres=CTc/postgres+
                  | sub_owner=C/postgres

\x
Expanded display is off.
--
\c - sub_owner 
You are now connected to database "tests_pg16" as user "sub_owner".
--
ALTER SUBSCRIPTION sub_pg16 CONNECTION 'host=/var/run/postgresql port=5437 user=user_pub_pg16 dbname=tests_pg16 application_name=preq';
psql:/home/benoit/tmp/password_required2.sql:20: ERROR:  password is required
DETAIL:  Non-superusers must provide a password in the connection string.
--
\c - postgres
You are now connected to database "tests_pg16" as user "postgres".
--
ALTER SUBSCRIPTION sub_pg16 SET (password_required = false) ;
ALTER SUBSCRIPTION
--
\c - sub_owner 
You are now connected to database "tests_pg16" as user "sub_owner".
--
ALTER SUBSCRIPTION sub_pg16 CONNECTION 'host=/var/run/postgresql port=5437 user=user_pub_pg16 dbname=tests_pg16 application_name=preq';
psql:/home/benoit/tmp/password_required2.sql:28: ERROR:  password_required=false is superuser-only
HINT:  Subscriptions with the password_required option set to false may only be created or modified by the superuser.
--
ALTER SUBSCRIPTION sub_pg16 DISABLE;
psql:/home/benoit/tmp/password_required2.sql:30: ERROR:  password_required=false is superuser-only
HINT:  Subscriptions with the password_required option set to false may only be created or modified by the superuser.
--
ALTER SUBSCRIPTION sub_pg16 ENABLE;
psql:/home/benoit/tmp/password_required2.sql:32: ERROR:  password_required=false is superuser-only
HINT:  Subscriptions with the password_required option set to false may only be created or modified by the superuser.
--
DROP SUBSCRIPTION sub_pg16;
psql:/home/benoit/tmp/password_required2.sql:34: NOTICE:  dropped replication slot "sub_pg16" on publisher
DROP SUBSCRIPTION