Skip to content

feat: AWS RDS Specific logic required for PG_repack#308

Open
tkcontiant wants to merge 4 commits intomovetokube:masterfrom
tkcontiant:feat/aws/rds/pg_repack
Open

feat: AWS RDS Specific logic required for PG_repack#308
tkcontiant wants to merge 4 commits intomovetokube:masterfrom
tkcontiant:feat/aws/rds/pg_repack

Conversation

@tkcontiant
Copy link
Copy Markdown
Contributor

@tkcontiant tkcontiant commented Mar 9, 2026

  • feat: This change introduces the AWS RDS-specific logic required to configure default privileges for users that will execute pg_repack.
  • fix: Alter database owner to desiredOwner if the owner role was changed

According to the AWS RDS documentation: AmazonRDS-DOCS

While the pg_repack extension installation is already handled natively by the operator, AWS RDS requires an additional step to grant the necessary permissions for the objects created during the repack process.

pg_repack creates temporary tables and sequences in the repack schema, and the executing user must have appropriate privileges on those objects. Without configuring the default privileges, the repack operation may fail due to insufficient permissions.

In this implementation, we assume that pg_repack will be executed by the database owner user, which is already responsible for managing the database objects.

Therefore, we configure the following default privileges in the repack schema:

ALTER DEFAULT PRIVILEGES FOR ROLE "%s" IN SCHEMA "repack" GRANT INSERT ON TABLES TO PUBLIC;

ALTER DEFAULT PRIVILEGES FOR ROLE "%s" IN SCHEMA "repack" GRANT USAGE, SELECT ON SEQUENCES TO PUBLIC;

This ensures that objects created by pg_repack during the operation can be accessed and modified as required by the executing role.

@tkcontiant tkcontiant changed the title feat: AWS RDS pg_repack privilidges support feat: AWS RDS-specific logic required PG_repack Mar 9, 2026
@tkcontiant tkcontiant force-pushed the feat/aws/rds/pg_repack branch from bf7f06a to d32fe47 Compare March 9, 2026 16:09
@tkcontiant tkcontiant changed the title feat: AWS RDS-specific logic required PG_repack feat: AWS RDS Specific logic required for PG_repack Mar 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant