0

I can access psql with 'psql -U postgres' followed by the password, but I can't access my defined user with the same 'psql -U definedUser' it just says 'definedUser isn't a database'.

Just to clarify.

How do I log in as a predefined user? How do I quickly access psql from the command line?

Lauro235
  • 121
  • 1
  • 8

1 Answers1

0

Okay, I think I've figured it out. This comment is what swung it.. Very succinct and easy to solve. If the user has been created successfully, by default when you log in with said user psql attempts to find a database of the same name if it doesn't you get an error like 'desiredUsername isn't a database'.

You need to add the database name after the chosen username

psql -U desiredUsername desiredDatabase

https://stackoverflow.com/a/21827460/15592981

Lauro235
  • 121
  • 1
  • 8