test: sanity tests for primary and replica
* new --replica option to `postgrest-with-postgresql-*` * new command `postgrest-test-replica` * new sanity tests on test_replica.py * add postgrest-test-replica to postgrest-check and postgrest-coverage
This commit is contained in:
committed by
Steve Chavez
parent
cdb877135b
commit
d9a51f23ce
@@ -0,0 +1,21 @@
|
||||
create schema replica;
|
||||
|
||||
create or replace function replica.is_replica() returns bool as $$
|
||||
select pg_is_in_recovery();
|
||||
$$ language sql;
|
||||
|
||||
create or replace function replica.get_replica_slot() returns name as $$
|
||||
select slot_name from pg_replication_slots limit 1;
|
||||
$$ language sql;
|
||||
|
||||
create table replica.items as select x as id from generate_series(1, 10) x;
|
||||
|
||||
DROP ROLE IF EXISTS postgrest_test_anonymous;
|
||||
CREATE ROLE postgrest_test_anonymous;
|
||||
|
||||
GRANT postgrest_test_anonymous TO :PGUSER;
|
||||
|
||||
GRANT USAGE ON SCHEMA replica TO postgrest_test_anonymous;
|
||||
|
||||
GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA replica
|
||||
TO postgrest_test_anonymous;
|
||||
Reference in New Issue
Block a user