mirror of
https://github.com/postgres/postgres.git
synced 2025-06-13 07:41:39 +03:00
Replace superuser check by ACLs for replication origin functions
This patch removes the hardcoded check for superuser privileges when executing replication origin functions. Instead, execution is revoked from public, meaning that those functions can be executed by a superuser and that access to them can be granted. Author: Martín Marqués Reviewed-by: Kyotaro Horiguchi, Michael Paquier, Masahiko Sawada Discussion: https:/postgr.es/m/CAPdiE1xJMZOKQL3dgHMUrPqysZkgwzSMXETfKkHYnBAB7-0VRQ@mail.gmail.com
This commit is contained in:
@ -1,6 +1,24 @@
|
||||
-- predictability
|
||||
SET synchronous_commit = on;
|
||||
|
||||
-- superuser required by default
|
||||
CREATE ROLE regress_origin_replication REPLICATION;
|
||||
SET ROLE regress_origin_replication;
|
||||
SELECT pg_replication_origin_advance('regress_test_decoding: perm', '0/1');
|
||||
SELECT pg_replication_origin_create('regress_test_decoding: perm');
|
||||
SELECT pg_replication_origin_drop('regress_test_decoding: perm');
|
||||
SELECT pg_replication_origin_oid('regress_test_decoding: perm');
|
||||
SELECT pg_replication_origin_progress('regress_test_decoding: perm', false);
|
||||
SELECT pg_replication_origin_session_is_setup();
|
||||
SELECT pg_replication_origin_session_progress(false);
|
||||
SELECT pg_replication_origin_session_reset();
|
||||
SELECT pg_replication_origin_session_setup('regress_test_decoding: perm');
|
||||
SELECT pg_replication_origin_xact_reset();
|
||||
SELECT pg_replication_origin_xact_setup('0/1', '2013-01-01 00:00');
|
||||
SELECT pg_show_replication_origin_status();
|
||||
RESET ROLE;
|
||||
DROP ROLE regress_origin_replication;
|
||||
|
||||
CREATE TABLE origin_tbl(id serial primary key, data text);
|
||||
CREATE TABLE target_tbl(id serial primary key, data text);
|
||||
|
||||
|
Reference in New Issue
Block a user