Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qQuKf-001MMk-EQ for pgsql-general@arkaria.postgresql.org; Tue, 01 Aug 2023 18:42:58 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qQuKd-009L2c-6W for pgsql-general@arkaria.postgresql.org; Tue, 01 Aug 2023 18:42:56 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qQuKc-009L0b-QN for pgsql-general@lists.postgresql.org; Tue, 01 Aug 2023 18:42:56 +0000 Received: from mail-qt1-x835.google.com ([2607:f8b0:4864:20::835]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qQuKa-000FaI-Vw for pgsql-general@lists.postgresql.org; Tue, 01 Aug 2023 18:42:55 +0000 Received: by mail-qt1-x835.google.com with SMTP id d75a77b69052e-40a9918ec08so21297341cf.0 for ; Tue, 01 Aug 2023 11:42:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1690915371; x=1691520171; h=in-reply-to:references:to:content-language:subject:user-agent :mime-version:date:message-id:from:from:to:cc:subject:date :message-id:reply-to; bh=Knc1pJlH/tXEy+GTeA9maWQl4OF0H+t5YET1erF06R8=; b=NFiTlrG2V+hfR++c2aJ51SwXWkeBPMQuLHpEekN68S0jXJ80uRqEe+AqsUtyreUoU+ 09k1uohxYft5/nkoAHG7Oh1OPzgFCIRNJ7LDvW2PWtdMpddsCbG9WX+MpzurcNKodWEt u6EH4NZVqs2YkSweiWZHBZwQYdE3rCuHUPjSUOYIPt8wlm7v5/tOY+QjY5Ee3Ax/1U2k wyL2ev57JHXCbBryYzRbNsuExj39YAtnjvQbqe5ENhVFllmfXxdD7peZvOMaVyONEoMu Sv3onLmtx+gLFZ1FKbiXYLq6DIzwxgfkID6A77gLUktkvnDmdidNo/BqzMRuzHKRO2v8 Uk1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690915371; x=1691520171; h=in-reply-to:references:to:content-language:subject:user-agent :mime-version:date:message-id:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Knc1pJlH/tXEy+GTeA9maWQl4OF0H+t5YET1erF06R8=; b=NMhhkxb/E3UJW2KHfePW6wB5cONytyz/+VIfOrQ19uaM7OS2FUc4ja8BUGCGT568u/ kgKFwOojB8yFRuokJubESf4kZbueIBtF26OzM07majLdIDm/tqYPPAf+1tX+lQWRqAdc hn0542kOJS7Evpoa1m2Muc+hrl2jercA2liDnkB/ZXfRPqftMH/bDMoXg6kgIgmiT34N 7SV5hUZ3YT5FRR6mLLIqE3J2Yv2q+rHIprLuFkjTFpStcoz2Z6ijUWawmFIwex1cnb2l HUGbOT3aWdmFY5LbNrSwus8+q6xMSGPAyPR6kWQ/TkZM+y1AbX0ZYC0KlNNbMC82TxI5 lHbg== X-Gm-Message-State: ABy/qLZ5fsTULNA6REIk3gpBp8yIzo/szWib98viOjEzjnXf0FQMAlwH 8whxHy1WE9aiTup8mc+R5cQnIMJmfR573w== X-Google-Smtp-Source: APBJJlHNDWAkJx9bxcHxcpi/a1eTA5V0biWfzgOUiBBJSADZuKgK3aG379ZxICvhmR9qPn5OZ2fNfQ== X-Received: by 2002:a05:6214:3011:b0:63d:25f:71af with SMTP id ke17-20020a056214301100b0063d025f71afmr14487022qvb.60.1690915370708; Tue, 01 Aug 2023 11:42:50 -0700 (PDT) Received: from [192.168.2.170] ([67.70.150.114]) by smtp.gmail.com with ESMTPSA id a9-20020a0c8bc9000000b00636aafcbacesm4876924qvc.56.2023.08.01.11.42.50 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 01 Aug 2023 11:42:50 -0700 (PDT) From: Amn Ojee Uw X-Google-Original-From: Amn Ojee Uw Content-Type: multipart/alternative; boundary="------------OXhFxOs7LrYZa7Us5ZTKR3jr" Message-ID: <148c784c-8eac-0bae-43c9-f819d265e288@gmail.com> Date: Tue, 1 Aug 2023 14:42:41 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.1 Subject: Re: error: connection to server on socket... Content-Language: en-US To: pgsql-general@lists.postgresql.org References: <97d77785-22a0-5d48-9582-4a7beb2dc14f@gmail.com> <863bf07c-6993-ce36-f260-6749ab327632@aklaver.com> In-Reply-To: <863bf07c-6993-ce36-f260-6749ab327632@aklaver.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --------------OXhFxOs7LrYZa7Us5ZTKR3jr Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Ah! Adrean, here is something interesting. /*pg_lsclusters*/ displays the following information /*Ver Cluster Port Status                Owner    Data directory              Log file*//* *//*12  main    5432 down,binaries_missing postgres /var/lib/postgresql/12/main /var/log/postgresql/postgresql-12-main.log*//* *//*15  main    5433 online                postgres /var/lib/postgresql/15/main /var/log/postgresql/postgresql-15-main.log*/ What is version 12 is doing there, I thought that I had completely removed it and replaced it with version 15!! Should I remove that log file? Regarding /pf@pfortin.com/ assertion, I am working with a _/Debian 12/_ machine and /*ls -l /tmp/.s.PGSQL.5432*/ displays the following error message : /*ls: cannot access '/tmp/.s.PGSQL.5432': No such file or directory*/ As for Tomas Pospisek questions : * as which user are you doing that (you can see that via `id`)? Due to matters of security let us assume that the output is : /*id*//* *//*uid=1000(my_account) gid=1000(my_account) groups=1000(my_account),24(cdrom),25(floppy),27(sudo),29(audio),30(dip),44(video),46(plugdev),100(users),*/ /*106(netdev),111(bluetooth),113(lpadmin),116(scanner),122(postgres),1001(tomcat)*/ * in which directory are you executing it  (you can see that via `pwd`)? /*/home/*//*my_account*/ * what is the home directory of the postgres user (you can see that via `grep postgres /etc/passwd`) /* */ /*~$ grep postgres /etc/passwd*//* *//*postgres:x:113:122:PostgreSQL administrator,,,:/var/lib/postgresql:/bin/bash*/ * what does `ls -ld /var/run/postgresql/; ls -l /var/run/postgresql/.s.PGSQL.5432` show? /*ls -ld /var/run/postgresql/*//* *//*drwxrwsr-x 2 postgres postgres 100 Jul 31 20:45 /var/run/postgresql/*/ /*ls -l /var/run/postgresql/.s.PGSQL.5432*//* *//*ls: cannot access '/var/run/postgresql/.s.PGSQL.5432': No such file or directory*/ - what does `journalctl -xeu postgresql` say? /*sudo journalctl -xeu postgresql*//* *//*[sudo] password for *//*/**//*my_account*/: *//* *//*░░ Support: https://www.debian.org/support*//* *//*░░ *//* *//*░░ A start job for unit postgresql.service has begun execution.*//* *//*░░ *//* *//*░░ The job identifier is 3496.*//* *//*Jul 31 20:45:13 *//*tree.com systemd[1]: Finished postgresql.service - PostgreSQL R>*//* *//*░░ Subject: A start job for unit postgresql.service has finished successfully*//* *//*░░ Defined-By: systemd*//* *//*░░ Support: https://www.debian.org/support*//* *//*░░ *//* *//*░░ A start job for unit postgresql.service has finished successfully.*//* *//*░░ *//* *//*░░ The job identifier is 3496.*//* *//*lines 4-16/16 (END)*/ - what does `tail -n 20 /var/log/postgresql/postgresql-*-qgisclouddb.log` show? /*sudo tail -n 20 /var/log/postgresql/postgresql-*-qgisclouddb.log*//* *//*tail: cannot open '/var/log/postgresql/postgresql-*-qgisclouddb.log' for reading: No such file or directory*/ I hope I was able to answer all the interesting questions posted as reply to my original post. /Thanks folks, I really appreciate the time you have dedicated to my question./ On 8/1/23 10:35 a.m., Adrian Klaver wrote: > On 8/1/23 03:22, Amn Ojee Uw wrote: >> Using the following command on my Debian 12 machine: >> >> /*sudo apt-get install postgresql postgresql-15 >> postgresql-client-common postgresql-common postgresql-contrib >> postgresql-doc phppgadmin >> */ >> >> >> and following the instruction on this >> web page I have >> installed PostgreSQL-15. >> The installation went smooth, until the following command was issued : >> >> /*sudo -u postgres psql*/ >> >> ... I get an error message that reads: >> >> /*could not change directory to "/home/my_account": Permission >> denied*//* >> *//*psql: error: connection to server on socket >> "/var/run/postgresql/.s.PGSQL.5432" failed: No such file or >> directory*//* >> *//*    Is the server running locally and accepting connections on >> that socket?*/ >> >> What can I do to resolve this issue? > > Run > > pg_lsclusters > > and see what port the server is running on. > >> >> Thanks in advance. >> > --------------OXhFxOs7LrYZa7Us5ZTKR3jr Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit

Ah! Adrean, here is something interesting.

pg_lsclusters displays the following information

Ver Cluster Port Status                Owner    Data directory              Log file
12  main    5432 down,binaries_missing postgres /var/lib/postgresql/12/main /var/log/postgresql/postgresql-12-main.log
15  main    5433 online                postgres /var/lib/postgresql/15/main /var/log/postgresql/postgresql-15-main.log

What is version 12 is doing there, I thought that I had completely removed it and replaced it with version 15!!
Should I remove that log file?

Regarding pf@pfortin.com assertion, I am working with a Debian 12 machine and ls -l /tmp/.s.PGSQL.5432
displays the following error message : ls: cannot access '/tmp/.s.PGSQL.5432': No such file or directory

As for Tomas Pospisek questions :
* as which user are you doing that (you can see that via `id`)?
Due to matters of security let us assume that the output is :
id
uid=1000(my_account) gid=1000(my_account) groups=1000(my_account),24(cdrom),25(floppy),27(sudo),29(audio),30(dip),44(video),46(plugdev),100(users),
106(netdev),111(bluetooth),113(lpadmin),116(scanner),122(postgres),1001(tomcat)

* in which directory are you executing it  (you can see that via `pwd`)?
/home/my_account
* what is the home directory of the postgres user (you can see that via `grep postgres /etc/passwd`)
~$ grep postgres /etc/passwd
postgres:x:113:122:PostgreSQL administrator,,,:/var/lib/postgresql:/bin/bash
* what does `ls -ld /var/run/postgresql/; ls -l /var/run/postgresql/.s.PGSQL.5432` show?
ls -ld /var/run/postgresql/
drwxrwsr-x 2 postgres postgres 100 Jul 31 20:45 /var/run/postgresql/

ls -l /var/run/postgresql/.s.PGSQL.5432
ls: cannot access '/var/run/postgresql/.s.PGSQL.5432': No such file or directory


- what does `journalctl -xeu postgresql` say?
sudo journalctl -xeu postgresql
[sudo] password for my_account:
░░ Support: https://www.debian.org/support
░░
░░ A start job for unit postgresql.service has begun execution.
░░
░░ The job identifier is 3496.
Jul 31 20:45:13  tree.com systemd[1]: Finished postgresql.service - PostgreSQL R>
░░ Subject: A start job for unit postgresql.service has finished successfully
░░ Defined-By: systemd
░░ Support: https://www.debian.org/support
░░
░░ A start job for unit postgresql.service has finished successfully.
░░
░░ The job identifier is 3496.
lines 4-16/16 (END)

- what does `tail -n 20 /var/log/postgresql/postgresql-*-qgisclouddb.log` show?
sudo tail -n 20 /var/log/postgresql/postgresql-*-qgisclouddb.log
tail: cannot open '/var/log/postgresql/postgresql-*-qgisclouddb.log' for reading: No such file or directory

I hope I was able to answer all the interesting questions posted as reply to my original post.

Thanks folks, I really appreciate the time you have dedicated to my question.


On 8/1/23 10:35 a.m., Adrian Klaver wrote:
On 8/1/23 03:22, Amn Ojee Uw wrote:
Using the following command on my Debian 12 machine:

/*sudo apt-get install postgresql postgresql-15 postgresql-client-common postgresql-common postgresql-contrib postgresql-doc phppgadmin
*/


and following the instruction on this <https://wiki.debian.org/PostgreSql#User_access> web page I have installed PostgreSQL-15.
The installation went smooth, until the following command was issued :

/*sudo -u postgres psql*/

... I get an error message that reads:

/*could not change directory to "/home/my_account": Permission denied*//*
*//*psql: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: No such file or directory*//*
*//*    Is the server running locally and accepting connections on that socket?*/

What can I do to resolve this issue?

Run

pg_lsclusters

and see what port the server is running on.


Thanks in advance.


--------------OXhFxOs7LrYZa7Us5ZTKR3jr--