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

build.sh fails if the user does not have CREATE DATABASE permissions. #21

Open
emelsimsek opened this issue Nov 4, 2024 · 0 comments
Open

Comments

@emelsimsek
Copy link

emelsimsek commented Nov 4, 2024

CreateUserDatabase fails with permission error:

Vuser 1:RUNNING
Vuser 1:Monitor Thread
Vuser 1:CREATING CLOUDSA SCHEMA
Vuser 1:CREATING DATABASE postgres under OWNER cloudsa
Vuser 1:Using existing User cloudsa for Schema build
Vuser 1:Using existing empty Database postgres for Schema build
Error in Virtual User 1: ERROR:  permission denied to change owner of database

is the PGUSER does not have CREATE DATABASE permissions.

It should be possible to skip ALTER DATABASE commands when they are not necessary to avoid permission errors. In this case
CreateUserDatabase function could check if the PGUSER is the owner of the database and skip the ALTER commands, this permission error can be avoided.

Quick and dirty workaround is to remove
set sql($stmnt_count) "ALTER DATABASE $db OWNER TO $user"

in CreateUserDatabase.

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

No branches or pull requests

1 participant