Обсуждение: pgadmin4 on Ubuntu

Поиск
Список
Период
Сортировка

pgadmin4 on Ubuntu

От
Adriano Peluso
Дата:
Hello,

I installed pgadmin4 on Ubuntu 22.04 through apt, following the instructions found here

I have a postgresql service running locally, installed with apt too

I'd like to connect pgadmin4 to the locally running postgres, possibly through a Unix socket

I have this
$ sudo ls -lha /var/run/postgresql/
totale 0
drwxrwsr-x  3 postgres postgres   60 set 21 07:08 .
drwxr-xr-x 42 root     root     1,2K set 21 07:08 ..
drwxr-s---  2 postgres postgres   40 set 21 07:08 14-main.pg_stat_tmp

I tried to create a connection in pgadmin4 but an error message reported: 

connection to server on socket
/var/run/postgresql/.s.PGSQL.5432

No such file or directory

Is the server running locally and accepting connections on that socket ?

Well, I don't know

I understand ths is more related to Ubuntu than it is to pgadmin4

Still I think it's appropriate to post here

Thanks for any hint

Re: pgadmin4 on Ubuntu

От
Yogesh Mahajan
Дата:
Hi,

Can you please try connecting postgres via psql? You might need to update the postgres setting mentioned over here.
Once you are able to connect with psql via terminal, you should be able to connect using pgAdmin too.

Thanks,
Yogesh Mahajan
EnterpriseDB


On Wed, Sep 21, 2022 at 11:05 AM Adriano Peluso <adriano.peluso@plusinnovation.it> wrote:
Hello,

I installed pgadmin4 on Ubuntu 22.04 through apt, following the instructions found here

I have a postgresql service running locally, installed with apt too

I'd like to connect pgadmin4 to the locally running postgres, possibly through a Unix socket

I have this
$ sudo ls -lha /var/run/postgresql/
totale 0
drwxrwsr-x  3 postgres postgres   60 set 21 07:08 .
drwxr-xr-x 42 root     root     1,2K set 21 07:08 ..
drwxr-s---  2 postgres postgres   40 set 21 07:08 14-main.pg_stat_tmp

I tried to create a connection in pgadmin4 but an error message reported: 

connection to server on socket
/var/run/postgresql/.s.PGSQL.5432

No such file or directory

Is the server running locally and accepting connections on that socket ?

Well, I don't know

I understand ths is more related to Ubuntu than it is to pgadmin4

Still I think it's appropriate to post here

Thanks for any hint

Re: pgadmin4 on Ubuntu

От
Adriano Peluso
Дата:


Il giorno mer 21 set 2022 alle ore 07:51 Yogesh Mahajan <yogesh.mahajan@enterprisedb.com> ha scritto:
Hi,

Can you please try connecting postgres via psql? You might need to update the postgres setting mentioned over here.
Once you are able to connect with psql via terminal, you should be able to connect using pgAdmin too.

Thanks,
Yogesh Mahajan
EnterpriseDB




Thanks for your reply

pgsql fails to connect with the exact same error that pgadmin4 reports

The step 1 in the reply you linked fails

In fact, there's no postgres daemon running, it seems

I have this

$ sudo systemctl status 'postgresql*'
× postgresql@14-main.service - PostgreSQL Cluster 14-main
     Loaded: loaded (/lib/systemd/system/postgresql@.service; enabled-runtime; vendor preset: enabled)
     Active: failed (Result: protocol) since Wed 2022-09-21 07:08:45 CEST; 1h 0min ago
        CPU: 68ms

set 21 07:08:45 me-laptop postgresql@14-main[976]: 2022-09-21 07:08:45.367 CEST [1116] LOG:  listening on Unix soc>
set 21 07:08:45 me-laptop postgresql@14-main[976]: 2022-09-21 07:08:45.377 CEST [1116] LOG:  peer authentication i>
set 21 07:08:45 me-laptop postgresql@14-main[976]: 2022-09-21 07:08:45.377 CEST [1116] CONTEXT:  line 97 of config>
set 21 07:08:45 me-laptop postgresql@14-main[976]: 2022-09-21 07:08:45.377 CEST [1116] FATAL:  could not load pg_h>
set 21 07:08:45 me-laptop postgresql@14-main[976]: 2022-09-21 07:08:45.378 CEST [1116] LOG:  database system is sh>
set 21 07:08:45 me-laptop postgresql@14-main[976]: pg_ctl: could not start server
set 21 07:08:45 me-laptop postgresql@14-main[976]: Examine the log output.
set 21 07:08:45 me-laptop systemd[1]: postgresql@14-main.service: Can't open PID file /run/postgresql/14-main.pid >
set 21 07:08:45 me-laptop systemd[1]: postgresql@14-main.service: Failed with result 'protocol'.
set 21 07:08:45 me-laptop systemd[1]: Failed to start PostgreSQL Cluster 14-main.

● postgresql.service - PostgreSQL RDBMS
     Loaded: loaded (/lib/systemd/system/postgresql.service; enabled; vendor preset: enabled)
     Active: active (exited) since Wed 2022-09-21 07:08:45 CEST; 1h 0min ago
   Main PID: 1194 (code=exited, status=0/SUCCESS)
        CPU: 810us

set 21 07:08:45 me-laptop systemd[1]: Starting PostgreSQL RDBMS...
set 21 07:08:45 me-laptop systemd[1]: Finished PostgreSQL RDBMS.



I don't understand what this means exactly

I need to investigate this further

If you have any suggestion about this, very appreciated

Thanks again

Re: pgadmin4 on Ubuntu

От
Adriano Peluso
Дата:
so,

 line 97of pg_hba.conf was unreadable

now psql DOES connect

AND pgadmin4 does too !! 👍🙂

Thank you so much !!  🙏



Re: pgadmin4 on Ubuntu

От
Yogesh Mahajan
Дата:

Great! 😊 

Thanks,
Yogesh Mahajan
EnterpriseDB


On Wed, Sep 21, 2022 at 12:12 PM Adriano Peluso <adriano.peluso@plusinnovation.it> wrote:
so,

 line 97of pg_hba.conf was unreadable

now psql DOES connect

AND pgadmin4 does too !! 👍🙂

Thank you so much !!  🙏