postgresai 0.17.0-dev.1 → 0.17.0-dev.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +236 -8
- package/dist/bin/postgres-ai.js +22275 -15524
- package/dist/sql/01.role.sql +2 -1
- package/dist/sql/02.extensions.sql +1 -1
- package/dist/sql/04.optional_rds.sql +2 -1
- package/dist/sql/06.helpers.sql +29 -8
- package/package.json +2 -2
- package/sql/01.role.sql +2 -1
- package/sql/02.extensions.sql +1 -1
- package/sql/04.optional_rds.sql +2 -1
- package/sql/06.helpers.sql +29 -8
- package/dist/sql/sql/01.role.sql +0 -16
- package/dist/sql/sql/02.extensions.sql +0 -8
- package/dist/sql/sql/03.permissions.sql +0 -86
- package/dist/sql/sql/04.optional_rds.sql +0 -6
- package/dist/sql/sql/05.optional_self_managed.sql +0 -8
- package/dist/sql/sql/06.helpers.sql +0 -317
- package/dist/sql/sql/uninit/01.helpers.sql +0 -5
- package/dist/sql/sql/uninit/02.permissions.sql +0 -30
- package/dist/sql/sql/uninit/03.role.sql +0 -27
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
-- Revoke permissions and drop objects created by prepare-db (template-filled by cli/lib/init.ts)
|
|
2
|
-
|
|
3
|
-
-- Drop the postgres_ai.pg_statistic view
|
|
4
|
-
drop view if exists postgres_ai.pg_statistic;
|
|
5
|
-
|
|
6
|
-
-- Drop the postgres_ai schema (CASCADE to handle any remaining objects)
|
|
7
|
-
drop schema if exists postgres_ai cascade;
|
|
8
|
-
|
|
9
|
-
-- Revoke permissions from the monitoring role
|
|
10
|
-
-- Use a DO block to handle the case where the role doesn't exist
|
|
11
|
-
do $$ begin
|
|
12
|
-
revoke pg_monitor from {{ROLE_IDENT}};
|
|
13
|
-
exception when undefined_object then
|
|
14
|
-
null; -- Role doesn't exist, nothing to revoke
|
|
15
|
-
end $$;
|
|
16
|
-
|
|
17
|
-
do $$ begin
|
|
18
|
-
revoke select on pg_catalog.pg_index from {{ROLE_IDENT}};
|
|
19
|
-
exception when undefined_object then
|
|
20
|
-
null; -- Role doesn't exist
|
|
21
|
-
end $$;
|
|
22
|
-
|
|
23
|
-
do $$ begin
|
|
24
|
-
revoke connect on database {{DB_IDENT}} from {{ROLE_IDENT}};
|
|
25
|
-
exception when undefined_object then
|
|
26
|
-
null; -- Role doesn't exist
|
|
27
|
-
end $$;
|
|
28
|
-
|
|
29
|
-
-- Note: USAGE on public is typically granted by default; we don't revoke it
|
|
30
|
-
-- to avoid breaking other applications that may rely on it.
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
-- Drop the monitoring role created by prepare-db (template-filled by cli/lib/init.ts)
|
|
2
|
-
-- This must run after revoking all permissions from the role.
|
|
3
|
-
|
|
4
|
-
-- Use a DO block to handle the case where the role doesn't exist
|
|
5
|
-
do $$ begin
|
|
6
|
-
-- Reassign owned objects to current user before dropping
|
|
7
|
-
-- This handles any objects that might have been created by the role
|
|
8
|
-
begin
|
|
9
|
-
execute format('reassign owned by %I to current_user', {{ROLE_LITERAL}});
|
|
10
|
-
exception when undefined_object then
|
|
11
|
-
null; -- Role doesn't exist, nothing to reassign
|
|
12
|
-
end;
|
|
13
|
-
|
|
14
|
-
-- Drop owned objects (in case reassign didn't work for some objects)
|
|
15
|
-
begin
|
|
16
|
-
execute format('drop owned by %I', {{ROLE_LITERAL}});
|
|
17
|
-
exception when undefined_object then
|
|
18
|
-
null; -- Role doesn't exist
|
|
19
|
-
end;
|
|
20
|
-
|
|
21
|
-
-- Drop the role
|
|
22
|
-
begin
|
|
23
|
-
execute format('drop role %I', {{ROLE_LITERAL}});
|
|
24
|
-
exception when undefined_object then
|
|
25
|
-
null; -- Role doesn't exist, that's fine
|
|
26
|
-
end;
|
|
27
|
-
end $$;
|