-1

When I create a database in pgadmin, it never asks me username/password for that database.

How do I define a database with such credentials:

  • DBName: mydb
  • username: phil
  • password: pass123
Prix
  • 18,774
  • 14
  • 65
  • 127
yarek
  • 8,962
  • 25
  • 93
  • 180

1 Answers1

1

PostgreSQL doesn't use ORACLE's logic, so a database hasn't 1:1 relation to a user. If you're creating a database, choose the DB owner. By default the DB owner is the current signed in user.

After creating a database, you can grant or revoke access rights, including changing DB owner.

If you want to create a new user, you have to separate it into two steps:

  1. create a user
  2. create a database with the user as a DB owner
Martin Strejc
  • 3,886
  • 2
  • 19
  • 34