Re: "Failed to connect to Postgres database"

Поиск
Список
Период
Сортировка
От Adrian Klaver
Тема Re: "Failed to connect to Postgres database"
Дата
Msg-id db155089-f552-f1c3-5079-53dee03eb7be@aklaver.com
обсуждение исходный текст
Ответ на Re: "Failed to connect to Postgres database"  (Marco Ippolito <ippolito.marco@gmail.com>)
Список pgsql-general
On 9/26/19 10:10 AM, Marco Ippolito wrote:
> Hi Adrian,
> 
> I removed the previous fabmentdb and created a new one whose owner is 
> postgres:
> 
> (base) postgres@pc:/usr/local/pgsql$ psql --cluster 11/fabmnet
> psql (11.5 (Ubuntu 11.5-1.pgdg18.04+1))
> Type "help" for help.
> 
> postgres=# \l
>                                List of databases
>     Name    |  Owner   | Encoding | Collate |  Ctype  |   Access privileges
> -----------+----------+----------+---------+---------+-----------------------
>   fabmnetdb | postgres | UTF8     | C.UTF-8 | C.UTF-8 |
>   postgres  | postgres | UTF8     | C.UTF-8 | C.UTF-8 |
>   template0 | postgres | UTF8     | C.UTF-8 | C.UTF-8 | =c/postgres     
>       +
>             |          |          |         |         | 
> postgres=CTc/postgres
>   template1 | postgres | UTF8     | C.UTF-8 | C.UTF-8 | =c/postgres     
>       +
>             |          |          |         |         | 
> postgres=CTc/postgres
> (4 rows)
> 
> postgres=#
> 
> _First objective: enable and make it working ssl connection for fabmnetd_b :
> 
> Following the indications found here: 
> https://vibhork.blogspot.com/2011/07/how-to-enable-ssl-in-postgresqlppas.html
> I created .pem and .req files in /var/lib/postgresql/11/fabmnet/  where, 
> according to nano /etc/postgresql/11/fabmnet/postgresql.conf, the data 
> folder is located:
>      data_directory = '/var/lib/postgresql/11/fabmnet'
>      ssl = on
> 
> 
> (base) postgres@pc:/var/lib/postgresql/11/fabmnet$ chmod 600 privkey.pem
> (base) postgres@pc:/var/lib/postgresql/11/fabmnet$ chmod 600 cert.req
> 
> But now, testing the ssl connection :
> 
> (base) marco@pc:/usr/local/pgsql$ psql -h 127.0.0.1 -d fabmnetdb -U postgres
> Password for user postgres:
> psql: FATAL:  database "fabmnetdb" does not exist
> 
> What am I missing?

My suspicion is that you have more then once instance of Postgres 
running. Partly because of this:

psql --cluster 11/fabmnet

and then later:

psql -h 127.0.0.1 -d fabmnetdb -U postgres

Not sure they are pointing at the same thing.



At command line what does:

ps ax | grep post

show.


> Thanks again for your kind help.
> Marco
> 



-- 
Adrian Klaver
adrian.klaver@aklaver.com



В списке pgsql-general по дате отправления:

Предыдущее
От: Adrian Klaver
Дата:
Сообщение: Re: row_to_json white space
Следующее
От: Adrian Klaver
Дата:
Сообщение: Re: row_to_json white space