1

I'm new to postgres.

I created a postgres docker container; when I access through the command "psql -U postgres" I access regularly and the prompt becomes like this: postgres=#.

(At the moment I have not created a database I have left the default one)

I created some superuser accounts, and in fact when I type \du, they appear in the table.

So far no problem.....

Now I would like to log in as one of these created users so I exit and go back to "root@@0c23b98444fc".

What's the problem?

When I try to access one of these users (with the psql -U kate command), I get the error:

" psql: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: FATAL: database "kate" does not exist.

I don't understand why the users were created regularly and I don't understand why the postgres user lets me log in while the others don't.

I hope for some help

1 Answer 1

0

you need to create database for kate or log in to default database with kate user.

example: psql -U kate postgres => to login to postgres database with kate user.

alternatively, create default database for kate:

psql -U postgres
CREATE DATABASE kate OWNER kate;
GRANT ALL PRIVILEGES on DATABASE kate to kate;

then next time you can login with psql -U kate

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .