Skip to content

fix: update SetDatabaseOwner for postgres #2414

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 30, 2025
Merged

Conversation

zreigz
Copy link
Member

@zreigz zreigz commented Jun 30, 2025

Change SetDatabaseOwner to grant all privileges

Test Plan

Checklist

  • If required, I have updated the Plural documentation accordingly.
  • I have added tests to cover my changes.
  • I have added a meaningful title and summary to convey the impact of this PR to a user.

Plural Flow: console

@zreigz zreigz changed the title update SetDatabaseOwner for postgres chore: update SetDatabaseOwner for postgres Jun 30, 2025
@zreigz zreigz added the bug-fix This pull request fixes a bug label Jun 30, 2025
@zreigz zreigz changed the title chore: update SetDatabaseOwner for postgres fix: update SetDatabaseOwner for postgres Jun 30, 2025
@@ -322,7 +286,7 @@ func (c *client) SetDatabaseOwner(database, username string) error {
}

// Set new owner
query := fmt.Sprintf(`ALTER DATABASE "%s" OWNER TO "%s"`, database, username)
query := fmt.Sprintf(`GRANT ALL PRIVILEGES ON DATABASE %s TO %s`, database, username)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'm guessing this works even if it was previously set right?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes

@michaeljguarino michaeljguarino merged commit 2595374 into master Jun 30, 2025
17 of 18 checks passed
@michaeljguarino michaeljguarino deleted the set-postgres-owner branch June 30, 2025 14:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug-fix This pull request fixes a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants