Files
postgrest/test/io/fixtures/replica.sql
T
Taimoor ZaeemandWolfgang Walther 9baf17aed0 fix: login with uppercase and mixed case role names
PostgREST failed when querying role settings where current
role name contained uppercase letters. This commit resolves
it by quoting the CURRENT_USER.

Signed-off-by: Taimoor Zaeem <taimoorzaeem@gmail.com>
2026-04-27 19:53:52 +00:00

22 lines
634 B
PL/PgSQL

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;