Skip to content

Conversation

@michaelkaye
Copy link
Contributor

This makes the commands for running as non-superuser able to be re-run without as many errors.

This was tested as working on PG 9.4, so should be fairly stable.

This will help those who (like me) are automating these commands as part of a deployment, so we don't need to dive through postgresql docs. I don't think it will affect those running them only once.

I admit it doesn't simply fix the CREATE ROLE failing because the user already exists, but PG doesn't have a good way to do that as far as I could see. It's better than nothing anyway.

Allow non-superuser commands to be re-run without (some) errors.
@coveralls
Copy link

Coverage Status

Coverage remained the same at 61.744% when pulling 1eaa724 on michaelkaye:michaelkaye/non-superuserdocs into 6d2cae6 on wrouesnel:master.

@baburdick
Copy link

Failing CREATE ROLE can be handled in various situations by an aggregate of the answers here: https://stackoverflow.com/questions/8092086/create-postgresql-role-user-if-it-doesnt-exist

@baburdick
Copy link

This should pull in the upstream changes to make it mergeable.

@asherf asherf mentioned this pull request Jun 15, 2019
@baburdick
Copy link

I agree this is better than nothing. But this should be closed in favor of #281, which is better still.

@wrouesnel
Copy link
Contributor

Closing in favor #281 which has been merged.

@wrouesnel wrouesnel closed this Jun 30, 2019
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.

4 participants