postgres-operator icon indicating copy to clipboard operation
postgres-operator copied to clipboard

User as DB Owner

Open suikast42 opened this issue 3 years ago • 1 comments

When I create a new user with the CRD then the owner of the new creates database is always postgres.

image

suikast42 avatar Jun 22 '22 07:06 suikast42

@suikast42 what you are seeing is intended/expected per the current design of PGO.

If you're having a specific issue with PGO (and more specifically the behavior you described), or if you would like to request an enhancement (e.g. to change this behavior), please provide the details request in either our Feature Request or Bug Report templates.

andrewlecuyer avatar Jul 13 '22 04:07 andrewlecuyer

Closing as intended behavior, please reopen if you need to make a feature request for some different behavior (along with the use-case

benjaminjb avatar Dec 29 '22 21:12 benjaminjb

Why would this be the intended behaviour? Currently I have to manually psql and run ALTER DATABASE myapp OWNER TO myapp; for every user and database combo, and I'd prefer if database owners could be declared within the CR itself, without giving the users additional privileges and having to use and maintain my own init scripts. Without setting the database owner as the user used by the app (assuming 1 user uses 1 database exclusively, so without additional RBAC like GRANT), I get permission denied errors. (To be clear, I'm using Crunchy-PGO in my homelab.)

From what I see on my Docker Postgres containers, their init scripts set the POSTGRES_USER as the owner of the created database specified by POSTGRES_DB.

JJGadgets avatar Nov 14 '23 00:11 JJGadgets

I would also be interested in this one. Due to this, a coupled deployment of gitlab is not working without manually adjusting the owner.

mikeywuu avatar Nov 19 '23 15:11 mikeywuu

+1 for a way to automatically grant ownership. I understand that the current behavior isn't a bug, but it's at least inconvenient for all usecases i can come up with.

keppla avatar Jan 16 '24 22:01 keppla