Skip to content

feat: postgres database resource#292

Merged
jason-lynch merged 6 commits intomainfrom
feat/PLAT-417/postgres-database-resource
Mar 31, 2026
Merged

feat: postgres database resource#292
jason-lynch merged 6 commits intomainfrom
feat/PLAT-417/postgres-database-resource

Conversation

@jason-lynch
Copy link
Copy Markdown
Member

@jason-lynch jason-lynch commented Mar 9, 2026

Summary

Adds a new PostgresDatabaseResource that shifts the Postgres database creation logic to happen later in the database creation process. Now, the InstanceResource is only responsible for creating the database users, and the PostgresDatabase resource is responsible for creating the Postgres database, granting role privileges to the new database, and initializing the Spock node.

This change is necessary because we need to use pg_service.conf for SystemD support, and we need that file to exist when we create the Spock node. This change shifts the Spock node initialization until after all of the instances are created and all nodes are ready, so we're able to construct the DSNs for all nodes before we initialize Spock.

This change has an added benefit that it opens up the possibility of support for multiple Postgres databases per Control Plane database since we're able to make multiple databases/spock nodes per NodeResource/Patroni cluster. I've added the DatabaseName field to most, if not all, of the resources that would need to change to accommodate this.

Testing

There should be no difference in user-facing functionality.

PLAT-417

Loading
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.

3 participants