Closed aco-fwinzek closed 3 months ago
Hi @aco-fwinzek. Thanks for reporting this. I was able to reproduce this. I'll push a fix in the next few days.
Hi @aco-fwinzek. I've created a fix and released it as version 0.5.5. Could you verify it works for you?
@swoehrl-mw Works like a charm. Thank you.
Description
Provisioning a database results with a user that is not privileged to create tables on the public schema when using postgres version >= 15.
Expected Behavior
Though postgres revoked the usage of the public schema, the operator should grant the user of the database all privileges on schema public regarding the code:
cursor.execute("GRANT ALL PRIVILEGES ON SCHEMA public TO %s", (AsIs(name),))
Setup / Steps to reproduce
Operator config:
Example Server/Database config:
On the schema public only the azure_pg_admin got UC privileges:
On the database test the user "test" got CTc privileges, which probably comes from
cursor.execute("GRANT ALL PRIVILEGES ON DATABASE %s TO %s", (AsIs(database), AsIs(name)))
:And, as expected, the user "test" has no permission to create tables:
But, when you look at the default postgres database, we see UC privileges for the user "test":
Suggestion
I think the problem is that with executing
cursor.execute("GRANT ALL PRIVILEGES ON SCHEMA public TO %s", (AsIs(name),))
it will be executed on the database that is currently active.The database connection is established with the admin-credentials which is probably the postgres database?