Added regression testing for --no-superuser-check option.
This commit is contained in:
parent
7471eeaa0c
commit
1f784089a6
@ -386,3 +386,20 @@ ERROR: cannot repack specific schema(s) in all databases
|
|||||||
--
|
--
|
||||||
\! pg_repack --dbname=contrib_regression --table=tbl_cluster --no-kill-backend
|
\! pg_repack --dbname=contrib_regression --table=tbl_cluster --no-kill-backend
|
||||||
INFO: repacking table "tbl_cluster"
|
INFO: repacking table "tbl_cluster"
|
||||||
|
--
|
||||||
|
-- no superuser check
|
||||||
|
--
|
||||||
|
DROP ROLE IF EXISTS nosuper;
|
||||||
|
CREATE ROLE nosuper WITH LOGIN;
|
||||||
|
-- => OK
|
||||||
|
\! pg_repack --dbname=contrib_regression --table=tbl_cluster --no-superuser-check
|
||||||
|
INFO: repacking table "tbl_cluster"
|
||||||
|
-- => ERROR
|
||||||
|
\! pg_repack --dbname=contrib_regression --table=tbl_cluster --username=nosuper
|
||||||
|
ERROR: pg_repack failed with error: You must be a superuser to use pg_repack
|
||||||
|
-- => ERROR
|
||||||
|
\! pg_repack --dbname=contrib_regression --table=tbl_cluster --username=nosuper --no-superuser-check
|
||||||
|
ERROR: pg_repack failed with error: ERROR: permission denied for schema repack
|
||||||
|
LINE 1: select repack.version(), repack.version_sql()
|
||||||
|
^
|
||||||
|
DROP ROLE IF EXISTS nosuper;
|
||||||
|
@ -232,3 +232,16 @@ CREATE TABLE test_schema2.tbl2 (id INTEGER PRIMARY KEY);
|
|||||||
-- don't kill backend
|
-- don't kill backend
|
||||||
--
|
--
|
||||||
\! pg_repack --dbname=contrib_regression --table=tbl_cluster --no-kill-backend
|
\! pg_repack --dbname=contrib_regression --table=tbl_cluster --no-kill-backend
|
||||||
|
|
||||||
|
--
|
||||||
|
-- no superuser check
|
||||||
|
--
|
||||||
|
DROP ROLE IF EXISTS nosuper;
|
||||||
|
CREATE ROLE nosuper WITH LOGIN;
|
||||||
|
-- => OK
|
||||||
|
\! pg_repack --dbname=contrib_regression --table=tbl_cluster --no-superuser-check
|
||||||
|
-- => ERROR
|
||||||
|
\! pg_repack --dbname=contrib_regression --table=tbl_cluster --username=nosuper
|
||||||
|
-- => ERROR
|
||||||
|
\! pg_repack --dbname=contrib_regression --table=tbl_cluster --username=nosuper --no-superuser-check
|
||||||
|
DROP ROLE IF EXISTS nosuper;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user