vitodeploy / vito

The Ultimate Server Management Tool
https://vitodeploy.com
GNU Affero General Public License v3.0
874 stars 149 forks source link

Postgres 16 - Database Owner Not Set #279

Open devsarfo opened 3 weeks ago

devsarfo commented 3 weeks ago

Describe the bug When you create a new database in Postgres 16 and assign a user to it, it uses postgres as the owner instead of the one set.

To Reproduce Steps to reproduce the behaviour:

  1. Create a Server with Postgres as the DB
  2. Go to databases
  3. Create a new database with a user
  4. SSH into server
  5. Switch to Postgres user using sudo -i -u postgres
  6. Access the PostgreSQL Command Line (psql) using psql
  7. Run \l and observe the owner of the database you created

Expected behaviour The Owner of the DB should be the one set in Vito and not posgres

Screenshots Vito image

psql image

Additional context

saeedvaziry commented 3 weeks ago

Shouldn't postgres user own all the databases? and the other users just have access? kinda similar to root access on mysql.

devsarfo commented 3 weeks ago

The staging user is required to own staging for the Laravel migrations to work. When the owner is set to staging, postgres user still has access. The PostgreSQL superuser always has access to everything within the database, regardless of ownership. This is why even after setting the owner to "staging," the postgres user still has access.

I created a new db and added the user, as you can see below, it gives you the error.

image image image
abdasis commented 2 weeks ago

I face this issue to