-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
  • 19,417
  • 15
  • 73
  • 132
yarek
  • 11,278
  • 30
  • 120
  • 219

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
  • 4,307
  • 2
  • 23
  • 38