Answer the question
In order to leave comments, you need to log in
Why can't I connect to postgres database?
[email protected]:~$ sudo -u postgres psql
psql (11.5 (Ubuntu 11.5-3.pgdg18.04+1))
Type "help" for help.
postgres=# select * from pg_database;
postgres=# create database secure;
CREATE DATABASE
postgres=# CREATE USER test_user WITH password 'qwerty';
CREATE ROLE
postgres=# GRANT ALL ON DATABASE secure TO test_user;
GRANT
postgres-# \q
[email protected]:~$ psql -h localhost secure test_user Test_user
password:
psql: FATAL: database "secure" does not exist
even though select * from pg_database;
everything seems to be normal
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question