From 81f99bedb466c26b84bc94753e1707530f20f7dc Mon Sep 17 00:00:00 2001 From: Mateus Zingano Date: Tue, 17 Nov 2026 15:44:11 -0300 Subject: [PATCH] feat: add default_privileges_expose_new_tables lint (0033) --- bin/installcheck | 2 +- ...33_default_privileges_expose_new_tables.md | 80 ++++++++++++ ...3_default_privileges_expose_new_tables.sql | 86 +++++++++++++ mkdocs.yaml | 1 + splinter.sql | 88 +++++++++++++- ...3_default_privileges_expose_new_tables.out | 115 ++++++++++++++++++ test/expected/queries_are_unionable.out | 7 +- ...3_default_privileges_expose_new_tables.sql | 103 ++++++++++++++++ test/sql/queries_are_unionable.sql | 8 +- 9 files changed, 486 insertions(+), 4 deletions(-) create mode 100644 docs/0033_default_privileges_expose_new_tables.md create mode 100644 lints/0033_default_privileges_expose_new_tables.sql create mode 100644 test/expected/0033_default_privileges_expose_new_tables.out create mode 100644 test/sql/0033_default_privileges_expose_new_tables.sql diff --git a/bin/installcheck b/bin/installcheck index 3a74aa7..f9d49d4 100755 --- a/bin/installcheck +++ b/bin/installcheck @@ -52,7 +52,7 @@ else fi # Execute the test fixtures -psql -v ON_ERROR_STOP= -f test/fixtures.sql -f lints/0001*.sql -f lints/0002*.sql -f lints/0003*.sql -f lints/0004*.sql -f lints/0005*.sql -f lints/0006*.sql -f lints/0007*.sql -f lints/0008*.sql -f lints/0009*.sql -f lints/0010*.sql -f lints/0011*.sql -f lints/0013*.sql -f lints/0014*.sql -f lints/0015*.sql -f lints/0016*.sql -f lints/0017*.sql -f lints/0018*.sql -f lints/0019*.sql -f lints/0020*.sql -f lints/0021*.sql -f lints/0022*.sql -f lints/0023*.sql -f lints/0024*.sql -f lints/0025*.sql -f lints/0026*.sql -f lints/0027*.sql -f lints/0028*.sql -f lints/0029*.sql -f lints/0030*.sql -f lints/0031*.sql -f lints/0032*.sql -d contrib_regression +psql -v ON_ERROR_STOP= -f test/fixtures.sql -f lints/0001*.sql -f lints/0002*.sql -f lints/0003*.sql -f lints/0004*.sql -f lints/0005*.sql -f lints/0006*.sql -f lints/0007*.sql -f lints/0008*.sql -f lints/0009*.sql -f lints/0010*.sql -f lints/0011*.sql -f lints/0013*.sql -f lints/0014*.sql -f lints/0015*.sql -f lints/0016*.sql -f lints/0017*.sql -f lints/0018*.sql -f lints/0019*.sql -f lints/0020*.sql -f lints/0021*.sql -f lints/0022*.sql -f lints/0023*.sql -f lints/0024*.sql -f lints/0025*.sql -f lints/0026*.sql -f lints/0027*.sql -f lints/0028*.sql -f lints/0029*.sql -f lints/0030*.sql -f lints/0031*.sql -f lints/0032*.sql -f lints/0033*.sql -d contrib_regression # Run tests ${REGRESS} --use-existing --dbname=contrib_regression --inputdir=${TESTDIR} ${TESTS} diff --git a/docs/0033_default_privileges_expose_new_tables.md b/docs/0033_default_privileges_expose_new_tables.md new file mode 100644 index 0000000..462ec4f --- /dev/null +++ b/docs/0033_default_privileges_expose_new_tables.md @@ -0,0 +1,80 @@ + +**Level:** WARN + +**Summary:** Default privileges grant every future table to `anon`, `authenticated` or `PUBLIC`. + +**Ramification:** Since October 30, 2026, new tables are not exposed to the Data API until you `grant` them. A default-privileges entry like this brings back automatic exposure for every table its owner creates. Nothing leaks because of it today, but the next table created without `enable row level security` can be read (and, with write privileges, changed) with the public anon key as soon as it exists. + +--- + +### Rationale + +On October 30, 2026 Supabase stopped exposing new tables in `public` to the Data API by default. Before, default privileges granted `select`, `insert`, `update` and `delete` on every new table to `anon`, `authenticated` and `service_role`, so a table was reachable through PostgREST and pg_graphql the moment it was created, protected or not. After the change, each table needs an explicit `grant`, which keeps access a reviewable, per-table decision. + +The first sign of the change is usually a `42501 permission denied for table` error. A common way to make it go away is to put the old behavior back: + +```sql +alter default privileges in schema public + grant select, insert, update, delete on tables to anon, authenticated; +``` + +That silences the error for every future table at once, and with it the safety net the change added: a table created by a migration, the SQL editor, the Management API or an AI tool is exposed before anyone has enabled RLS or written a policy. + +The lint reports one row per owner role and schema (or one row for an entry without `in schema`, which applies to every schema). It only looks at table defaults (`on tables`): sequences and functions are out of scope. Entries owned by platform roles (`supabase_*`, `pg_*`) are skipped because the project owner can't change them. Entries that only grant to `service_role` are not reported. + +### How to Resolve + +**Option 1: Revoke the default privileges and grant per table (recommended)** + +Use the owner and schema from the finding: + +```sql +alter default privileges for role postgres in schema public + revoke all on tables from anon, authenticated, public; +``` + +Then grant each table in the migration that creates it, next to its RLS policies, and only the privileges each role needs: + +```sql +create table public.notes ( + id bigint generated always as identity primary key, + user_id uuid not null default auth.uid(), + body text +); +alter table public.notes enable row level security; + +grant select, insert, update, delete on public.notes to authenticated; + +create policy "own notes" on public.notes + for all to authenticated + using ((select auth.uid()) = user_id) + with check ((select auth.uid()) = user_id); +``` + +Revoking default privileges does not change tables that already exist: they keep the grants they have. + +**Option 2: Keep the defaults, with a guarantee that RLS is always on** + +If you keep the defaults on purpose, make sure every table in the exposed schemas gets RLS when it is created, for example with an event trigger, and watch lints `0013_rls_disabled_in_public` and `0008_rls_enabled_no_policy`. Without that guarantee, keeping the defaults is exactly the exposure the October 30 change removed. + +### Example + +The quick fix after the first 42501: + +```sql +alter default privileges for role postgres in schema public + grant select, insert, update, delete on tables to anon, authenticated; +``` + +Fix: + +```sql +alter default privileges for role postgres in schema public + revoke all on tables from anon, authenticated; + +grant select on public.your_table to authenticated; +``` + +### False Positives + +A project that deliberately exposes every new table, and enforces RLS on creation some other way, can treat this finding as accepted. A default that grants only to `service_role` is never reported. diff --git a/lints/0033_default_privileges_expose_new_tables.sql b/lints/0033_default_privileges_expose_new_tables.sql new file mode 100644 index 0000000..07dcd60 --- /dev/null +++ b/lints/0033_default_privileges_expose_new_tables.sql @@ -0,0 +1,86 @@ +create view lint."0033_default_privileges_expose_new_tables" as + +-- Detects ALTER DEFAULT PRIVILEGES entries that grant table privileges +-- to `anon`, `authenticated` or `PUBLIC` in a schema exposed through +-- the Data API (or in every schema). Since October 30, 2026 new tables +-- are no longer exposed automatically: each one needs an explicit +-- GRANT. A default-privileges entry like this re-creates the old +-- behavior for every table its owner creates from now on, usually +-- added to silence the first 42501 "permission denied for table". +-- Nothing is exposed by it today; the next table created without +-- `enable row level security` is readable (and writable) with the +-- public anon key the moment it exists. +-- +-- Default privileges owned by platform roles (supabase_*, pg_*) are +-- skipped: the project owner cannot alter them. +select + 'default_privileges_expose_new_tables' as name, + 'Default Privileges Expose New Tables' as title, + 'WARN' as level, + 'EXTERNAL' as facing, + array['SECURITY'] as categories, + 'Detects default privileges that grant every future table to the API roles, re-enabling automatic Data API exposure. Revoke them and grant each new table explicitly in the migration that creates it.' as description, + format( + 'Default privileges make every table `%s` creates in %s accessible to %s.', + owner_name, + case when schema_name is null then 'any schema' else format('schema `%s`', schema_name) end, + grants + ) as detail, + 'https://supabase.com/docs/guides/database/database-linter?lint=0033_default_privileges_expose_new_tables' as remediation, + jsonb_build_object( + 'owner', owner_name, + 'schema', schema_name, + 'grants', grants, + 'type', 'default_privileges' + ) as metadata, + format( + 'default_privileges_expose_new_tables_%s_%s', + owner_name, + coalesce(schema_name, '*') + ) as cache_key +from + ( + select + owner_name, + schema_name, + string_agg(grantee_name || ' (' || privileges || ')', ', ' order by grantee_name) as grants + from + ( + select + pg_catalog.pg_get_userbyid(d.defaclrole) as owner_name, + n.nspname as schema_name, + case when a.grantee = 0 then 'PUBLIC' else pg_catalog.pg_get_userbyid(a.grantee) end as grantee_name, + string_agg(a.privilege_type, ', ' order by a.privilege_type) as privileges + from + pg_catalog.pg_default_acl d + left join pg_catalog.pg_namespace n + on n.oid = d.defaclnamespace + cross join lateral pg_catalog.aclexplode(d.defaclacl) a + where + d.defaclobjtype = 'r' + and ( + a.grantee = 0 + or pg_catalog.pg_get_userbyid(a.grantee) in ('anon', 'authenticated') + ) + and ( + d.defaclnamespace = 0 + or n.nspname = any(array(select trim(unnest(string_to_array(coalesce(current_setting('pgrst.db_schemas', 't'), 'public'), ','))))) + ) + and ( + n.nspname is null + or n.nspname not in ( + '_timescaledb_cache', '_timescaledb_catalog', '_timescaledb_config', '_timescaledb_internal', 'auth', 'cron', 'extensions', 'graphql', 'graphql_public', 'information_schema', 'net', 'pgmq', 'pgroonga', 'pgsodium', 'pgsodium_masks', 'pgtle', 'pgbouncer', 'pg_catalog', 'realtime', 'repack', 'storage', 'supabase_functions', 'supabase_migrations', 'tiger', 'topology', 'vault' + ) + ) + and pg_catalog.pg_get_userbyid(d.defaclrole) not like 'supabase\_%' + and pg_catalog.pg_get_userbyid(d.defaclrole) not like 'pg\_%' + group by + 1, 2, 3 + ) per_grantee + group by + owner_name, + schema_name + ) exposing_defaults +order by + owner_name, + schema_name nulls first; diff --git a/mkdocs.yaml b/mkdocs.yaml index bf45eb5..98d8e08 100644 --- a/mkdocs.yaml +++ b/mkdocs.yaml @@ -40,6 +40,7 @@ nav: - Autovacuum Disabled: '0030_autovacuum_disabled.md' - Public Can Execute Dynamic SQL Function: '0031_anon_dynamic_sql_function_executable.md' - Signed-In Users Can Execute Dynamic SQL Function: '0032_authenticated_dynamic_sql_function_executable.md' + - Default Privileges Expose New Tables: '0033_default_privileges_expose_new_tables.md' theme: name: 'material' diff --git a/splinter.sql b/splinter.sql index dd36e57..10af19c 100644 --- a/splinter.sql +++ b/splinter.sql @@ -2336,4 +2336,90 @@ from order by schema_name, function_name, - function_args) \ No newline at end of file + function_args) +union all +( +-- Detects ALTER DEFAULT PRIVILEGES entries that grant table privileges +-- to `anon`, `authenticated` or `PUBLIC` in a schema exposed through +-- the Data API (or in every schema). Since October 30, 2026 new tables +-- are no longer exposed automatically: each one needs an explicit +-- GRANT. A default-privileges entry like this re-creates the old +-- behavior for every table its owner creates from now on, usually +-- added to silence the first 42501 "permission denied for table". +-- Nothing is exposed by it today the next table created without +-- `enable row level security` is readable (and writable) with the +-- public anon key the moment it exists. +-- +-- Default privileges owned by platform roles (supabase_*, pg_*) are +-- skipped: the project owner cannot alter them. +select + 'default_privileges_expose_new_tables' as name, + 'Default Privileges Expose New Tables' as title, + 'WARN' as level, + 'EXTERNAL' as facing, + array['SECURITY'] as categories, + 'Detects default privileges that grant every future table to the API roles, re-enabling automatic Data API exposure. Revoke them and grant each new table explicitly in the migration that creates it.' as description, + format( + 'Default privileges make every table `%s` creates in %s accessible to %s.', + owner_name, + case when schema_name is null then 'any schema' else format('schema `%s`', schema_name) end, + grants + ) as detail, + 'https://supabase.com/docs/guides/database/database-linter?lint=0033_default_privileges_expose_new_tables' as remediation, + jsonb_build_object( + 'owner', owner_name, + 'schema', schema_name, + 'grants', grants, + 'type', 'default_privileges' + ) as metadata, + format( + 'default_privileges_expose_new_tables_%s_%s', + owner_name, + coalesce(schema_name, '*') + ) as cache_key +from + ( + select + owner_name, + schema_name, + string_agg(grantee_name || ' (' || privileges || ')', ', ' order by grantee_name) as grants + from + ( + select + pg_catalog.pg_get_userbyid(d.defaclrole) as owner_name, + n.nspname as schema_name, + case when a.grantee = 0 then 'PUBLIC' else pg_catalog.pg_get_userbyid(a.grantee) end as grantee_name, + string_agg(a.privilege_type, ', ' order by a.privilege_type) as privileges + from + pg_catalog.pg_default_acl d + left join pg_catalog.pg_namespace n + on n.oid = d.defaclnamespace + cross join lateral pg_catalog.aclexplode(d.defaclacl) a + where + d.defaclobjtype = 'r' + and ( + a.grantee = 0 + or pg_catalog.pg_get_userbyid(a.grantee) in ('anon', 'authenticated') + ) + and ( + d.defaclnamespace = 0 + or n.nspname = any(array(select trim(unnest(string_to_array(coalesce(current_setting('pgrst.db_schemas', 't'), 'public'), ','))))) + ) + and ( + n.nspname is null + or n.nspname not in ( + '_timescaledb_cache', '_timescaledb_catalog', '_timescaledb_config', '_timescaledb_internal', 'auth', 'cron', 'extensions', 'graphql', 'graphql_public', 'information_schema', 'net', 'pgmq', 'pgroonga', 'pgsodium', 'pgsodium_masks', 'pgtle', 'pgbouncer', 'pg_catalog', 'realtime', 'repack', 'storage', 'supabase_functions', 'supabase_migrations', 'tiger', 'topology', 'vault' + ) + ) + and pg_catalog.pg_get_userbyid(d.defaclrole) not like 'supabase\_%' + and pg_catalog.pg_get_userbyid(d.defaclrole) not like 'pg\_%' + group by + 1, 2, 3 + ) per_grantee + group by + owner_name, + schema_name + ) exposing_defaults +order by + owner_name, + schema_name nulls first) \ No newline at end of file diff --git a/test/expected/0033_default_privileges_expose_new_tables.out b/test/expected/0033_default_privileges_expose_new_tables.out new file mode 100644 index 0000000..7f2ec2a --- /dev/null +++ b/test/expected/0033_default_privileges_expose_new_tables.out @@ -0,0 +1,115 @@ +begin; + set local search_path = ''; + set local pgrst.db_schemas = 'public'; + -- test/fixtures.sql mirrors the pre-October-30 platform default + -- (select on new tables in public to PUBLIC), which other lints' + -- tests rely on. Start this file from the post-change state. + alter default privileges in schema public revoke select on tables from public; + -- BASELINE: no default privileges for the API roles, no rows + select * from lint."0033_default_privileges_expose_new_tables"; + name | title | level | facing | categories | description | detail | remediation | metadata | cache_key +------+-------+-------+--------+------------+-------------+--------+-------------+----------+----------- +(0 rows) + + savepoint a; + ---------------------------------------- + -- NEGATIVE EXAMPLE: default privileges for service_role only. The + -- service key already bypasses RLS and never reaches the browser, + -- so this does not expose new tables to the public API. + ---------------------------------------- + create role service_role; + alter default privileges for role postgres in schema public + grant select, insert, update, delete on tables to service_role; + select * from lint."0033_default_privileges_expose_new_tables"; + name | title | level | facing | categories | description | detail | remediation | metadata | cache_key +------+-------+-------+--------+------------+-------------+--------+-------------+----------+----------- +(0 rows) + + rollback to savepoint a; + savepoint b; + ---------------------------------------- + -- NEGATIVE EXAMPLE: default privileges to anon, but in a schema that + -- is not exposed through the Data API (not in pgrst.db_schemas). + ---------------------------------------- + create schema private_stuff; + alter default privileges for role postgres in schema private_stuff + grant select on tables to anon; + select * from lint."0033_default_privileges_expose_new_tables"; + name | title | level | facing | categories | description | detail | remediation | metadata | cache_key +------+-------+-------+--------+------------+-------------+--------+-------------+----------+----------- +(0 rows) + + rollback to savepoint b; + savepoint c; + ---------------------------------------- + -- NEGATIVE EXAMPLE: default privileges on sequences and functions are + -- out of scope; this lint is about tables appearing in the API. + ---------------------------------------- + alter default privileges for role postgres in schema public + grant usage, select on sequences to anon; + select * from lint."0033_default_privileges_expose_new_tables"; + name | title | level | facing | categories | description | detail | remediation | metadata | cache_key +------+-------+-------+--------+------------+-------------+--------+-------------+----------+----------- +(0 rows) + + rollback to savepoint c; + savepoint case_lazy_fix; + ---------------------------------------- + -- POSITIVE: the "lazy fix" for the first 42501 after October 30, + -- 2026. Every table postgres creates in public from now on is + -- readable and writable by anon and authenticated on creation. + ---------------------------------------- + alter default privileges for role postgres in schema public + grant select, insert, update, delete on tables to anon, authenticated; + select + name, + detail, + metadata->>'owner' as owner, + metadata->>'schema' as schema, + cache_key + from lint."0033_default_privileges_expose_new_tables"; + name | detail | owner | schema | cache_key +--------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------+--------+------------------------------------------------------ + default_privileges_expose_new_tables | Default privileges make every table `postgres` creates in schema `public` accessible to anon (DELETE, INSERT, SELECT, UPDATE), authenticated (DELETE, INSERT, SELECT, UPDATE). | postgres | public | default_privileges_expose_new_tables_postgres_public +(1 row) + + ---------------------------------------- + -- RESOLUTION: revoke the default privileges. New tables need an + -- explicit grant again and the lint clears. + ---------------------------------------- + alter default privileges for role postgres in schema public + revoke all on tables from anon, authenticated; + select * from lint."0033_default_privileges_expose_new_tables"; + name | title | level | facing | categories | description | detail | remediation | metadata | cache_key +------+-------+-------+--------+------------+-------------+--------+-------------+----------+----------- +(0 rows) + + rollback to savepoint case_lazy_fix; + savepoint case_global_public; + ---------------------------------------- + -- POSITIVE: a default without IN SCHEMA applies to every schema, + -- including the exposed ones. Granting to PUBLIC covers anon and + -- authenticated too. + ---------------------------------------- + alter default privileges for role postgres + grant select on tables to public; + select + name, + detail, + metadata->>'schema' as schema, + cache_key + from lint."0033_default_privileges_expose_new_tables"; + name | detail | schema | cache_key +--------------------------------------+-----------------------------------------------------------------------------------------------------+--------+------------------------------------------------- + default_privileges_expose_new_tables | Default privileges make every table `postgres` creates in any schema accessible to PUBLIC (SELECT). | | default_privileges_expose_new_tables_postgres_* +(1 row) + + alter default privileges for role postgres + revoke select on tables from public; + select * from lint."0033_default_privileges_expose_new_tables"; + name | title | level | facing | categories | description | detail | remediation | metadata | cache_key +------+-------+-------+--------+------------+-------------+--------+-------------+----------+----------- +(0 rows) + + rollback to savepoint case_global_public; +rollback; diff --git a/test/expected/queries_are_unionable.out b/test/expected/queries_are_unionable.out index e7738bd..ef7c10a 100644 --- a/test/expected/queries_are_unionable.out +++ b/test/expected/queries_are_unionable.out @@ -1,5 +1,8 @@ begin; set local search_path = ''; + -- test/fixtures.sql mirrors the pre-October-30 platform default, which + -- lint 0033 reports; clear it so the union stays empty on a clean schema. + alter default privileges in schema public revoke select on tables from public; select * from lint."0001_unindexed_foreign_keys" union all select * from lint."0002_auth_users_exposed" @@ -60,7 +63,9 @@ begin; union all select * from lint."0031_anon_dynamic_sql_function_executable" union all - select * from lint."0032_authenticated_dynamic_sql_function_executable"; + select * from lint."0032_authenticated_dynamic_sql_function_executable" + union all + select * from lint."0033_default_privileges_expose_new_tables"; name | title | level | facing | categories | description | detail | remediation | metadata | cache_key ------+-------+-------+--------+------------+-------------+--------+-------------+----------+----------- (0 rows) diff --git a/test/sql/0033_default_privileges_expose_new_tables.sql b/test/sql/0033_default_privileges_expose_new_tables.sql new file mode 100644 index 0000000..6eb46c6 --- /dev/null +++ b/test/sql/0033_default_privileges_expose_new_tables.sql @@ -0,0 +1,103 @@ +begin; + set local search_path = ''; + set local pgrst.db_schemas = 'public'; + + -- test/fixtures.sql mirrors the pre-October-30 platform default + -- (select on new tables in public to PUBLIC), which other lints' + -- tests rely on. Start this file from the post-change state. + alter default privileges in schema public revoke select on tables from public; + + -- BASELINE: no default privileges for the API roles, no rows + select * from lint."0033_default_privileges_expose_new_tables"; + + savepoint a; + + ---------------------------------------- + -- NEGATIVE EXAMPLE: default privileges for service_role only. The + -- service key already bypasses RLS and never reaches the browser, + -- so this does not expose new tables to the public API. + ---------------------------------------- + create role service_role; + alter default privileges for role postgres in schema public + grant select, insert, update, delete on tables to service_role; + select * from lint."0033_default_privileges_expose_new_tables"; + + rollback to savepoint a; + + savepoint b; + + ---------------------------------------- + -- NEGATIVE EXAMPLE: default privileges to anon, but in a schema that + -- is not exposed through the Data API (not in pgrst.db_schemas). + ---------------------------------------- + create schema private_stuff; + alter default privileges for role postgres in schema private_stuff + grant select on tables to anon; + select * from lint."0033_default_privileges_expose_new_tables"; + + rollback to savepoint b; + + savepoint c; + + ---------------------------------------- + -- NEGATIVE EXAMPLE: default privileges on sequences and functions are + -- out of scope; this lint is about tables appearing in the API. + ---------------------------------------- + alter default privileges for role postgres in schema public + grant usage, select on sequences to anon; + select * from lint."0033_default_privileges_expose_new_tables"; + + rollback to savepoint c; + + savepoint case_lazy_fix; + + ---------------------------------------- + -- POSITIVE: the "lazy fix" for the first 42501 after October 30, + -- 2026. Every table postgres creates in public from now on is + -- readable and writable by anon and authenticated on creation. + ---------------------------------------- + alter default privileges for role postgres in schema public + grant select, insert, update, delete on tables to anon, authenticated; + + select + name, + detail, + metadata->>'owner' as owner, + metadata->>'schema' as schema, + cache_key + from lint."0033_default_privileges_expose_new_tables"; + + ---------------------------------------- + -- RESOLUTION: revoke the default privileges. New tables need an + -- explicit grant again and the lint clears. + ---------------------------------------- + alter default privileges for role postgres in schema public + revoke all on tables from anon, authenticated; + select * from lint."0033_default_privileges_expose_new_tables"; + + rollback to savepoint case_lazy_fix; + + savepoint case_global_public; + + ---------------------------------------- + -- POSITIVE: a default without IN SCHEMA applies to every schema, + -- including the exposed ones. Granting to PUBLIC covers anon and + -- authenticated too. + ---------------------------------------- + alter default privileges for role postgres + grant select on tables to public; + + select + name, + detail, + metadata->>'schema' as schema, + cache_key + from lint."0033_default_privileges_expose_new_tables"; + + alter default privileges for role postgres + revoke select on tables from public; + select * from lint."0033_default_privileges_expose_new_tables"; + + rollback to savepoint case_global_public; + +rollback; diff --git a/test/sql/queries_are_unionable.sql b/test/sql/queries_are_unionable.sql index 6169d02..ab31e0e 100644 --- a/test/sql/queries_are_unionable.sql +++ b/test/sql/queries_are_unionable.sql @@ -2,6 +2,10 @@ begin; set local search_path = ''; + -- test/fixtures.sql mirrors the pre-October-30 platform default, which + -- lint 0033 reports; clear it so the union stays empty on a clean schema. + alter default privileges in schema public revoke select on tables from public; + select * from lint."0001_unindexed_foreign_keys" union all select * from lint."0002_auth_users_exposed" @@ -62,6 +66,8 @@ begin; union all select * from lint."0031_anon_dynamic_sql_function_executable" union all - select * from lint."0032_authenticated_dynamic_sql_function_executable"; + select * from lint."0032_authenticated_dynamic_sql_function_executable" + union all + select * from lint."0033_default_privileges_expose_new_tables"; rollback;