Skip to content
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

Allow creating PostgreSQL database "with owner" #3

Open
AnthonyMastrean opened this issue Feb 11, 2020 · 1 comment
Open

Allow creating PostgreSQL database "with owner" #3

AnthonyMastrean opened this issue Feb 11, 2020 · 1 comment
Labels
enhancement New feature or request

Comments

@AnthonyMastrean
Copy link

AnthonyMastrean commented Feb 11, 2020

The PostgreSQL CREATE DATABASE statement requires a superuser account and the WITH OWNER clause allows you to change ownership to, say, a normal service account.

It would be super nice to have this option in the PostgresqlDatabase method to minimize the use of a superuser connection string.

            sqlCommandText = string.Format
                (
                    "create database \"{0}\";",
                    databaseName
                );

https://github.com/DbUp/DbUp/blob/master/src/dbup-postgresql/PostgresqlExtensions.cs#L189-L193

@AnthonyMastrean AnthonyMastrean added the enhancement New feature or request label Feb 11, 2020
@AaronShiels
Copy link

Would be great to see this.

We've implemented a workaround to a similar problem (assigning ownership at the schema level) by inheriting the ScriptExecutor and override the GetVerifySchemaSql(string schema);, so this is definitely on my wishlist.

@droyad droyad transferred this issue from DbUp/DbUp Jan 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Wishlist
Development

No branches or pull requests

2 participants