feat: Include partitioned tables into the schema cache

Allows embedding, UPSERT, INSERT with Location response, OPTIONS request and OpenAPI support for partitioned tables
This commit is contained in:
laurenceisla
2021-08-13 15:06:56 -05:00
committed by GitHub
parent b3899e7aa4
commit 4e4548d702
12 changed files with 351 additions and 49 deletions
+20
View File
@@ -179,3 +179,23 @@ REVOKE EXECUTE ON FUNCTION privileged_hello(text) FROM PUBLIC; -- All functions
GRANT EXECUTE ON FUNCTION privileged_hello(text) TO postgrest_test_author;
GRANT USAGE ON SCHEMA test TO postgrest_test_default_role;
DO $do$BEGIN
IF (SELECT current_setting('server_version_num')::INT >= 100000) THEN
GRANT ALL ON TABLE test.partitioned_a TO postgrest_test_anonymous;
GRANT ALL ON TABLE test.first_partition_a TO postgrest_test_anonymous;
GRANT ALL ON TABLE test.second_partition_a TO postgrest_test_anonymous;
END IF;
IF (SELECT current_setting('server_version_num')::INT >= 110000) THEN
GRANT ALL ON TABLE test.reference_from_partitioned TO postgrest_test_anonymous;
END IF;
IF (SELECT current_setting('server_version_num')::INT >= 120000) THEN
GRANT ALL ON TABLE test.partitioned_b TO postgrest_test_anonymous;
GRANT ALL ON TABLE test.first_partition_b TO postgrest_test_anonymous;
GRANT ALL ON TABLE test.second_partition_b TO postgrest_test_anonymous;
GRANT ALL ON TABLE test.reference_to_partitioned TO postgrest_test_anonymous;
END IF;
END$do$;