Re: error on connecting port 5432

2020-12-02 Thread Adrian Klaver
On 12/1/20 11:02 PM, Atul Kumar wrote: Thanks a lot Tom, I appended the -h /tmp and it worked. I need just one more help from you. Could you tell me that why & how that socket file existed in /tmp directory. What is the practice to make sure that this file (.s.PGSQL.5432) should be inside /var

Re: error on connecting port 5432

2020-12-01 Thread David G. Johnston
On Wednesday, December 2, 2020, Atul Kumar wrote: > Thanks a lot Tom, I appended the -h /tmp and it worked. > > I need just one more help from you. > > Could you tell me that why & how that socket file existed in /tmp > directory. > Because the server was configured that way: https://www.postg

Re: error on connecting port 5432

2020-12-01 Thread Andreas Schmitz
You might want to give https://www.postgresql.org/docs/13/runtime-config-connection.html a read regards Andreas Am 12/2/2020 um 8:02 AM schrieb Atul Kumar: > Thanks a lot Tom, I appended the -h /tmp and it worked. > > I need just one more help from you. > > Could you tell me that why & how that

Re: error on connecting port 5432

2020-12-01 Thread Atul Kumar
Thanks a lot Tom, I appended the -h /tmp and it worked. I need just one more help from you. Could you tell me that why & how that socket file existed in /tmp directory. What is the practice to make sure that this file (.s.PGSQL.5432) should be inside /var/run directory ? so that it will not thro

Re: error on connecting port 5432

2020-12-01 Thread David G. Johnston
On Tuesday, December 1, 2020, Atul Kumar wrote: > > There is no directory of postgresql in /var/run. Wasn’t expecting there to be, that’s what you get the error. > Please help me out. > Since “su - postgres” works for psql just do that for createuser. Or do what Tom said and specify -h /tmp

Re: error on connecting port 5432

2020-12-01 Thread Atul Kumar
hi, There is no directory of postgresql in /var/run. Please help me out. Regards, Atul On 12/1/20, Tom Lane wrote: > Atul Kumar writes: >> Just to clarify that I am at root OS user, trying to create a test user >> using postgres user(-u) with create user command. > > Given the reference

Re: error on connecting port 5432

2020-12-01 Thread Adrian Klaver
On 12/1/20 8:10 AM, Atul Kumar wrote: Hi, Just to clarify that I am at root OS user, trying to create a test user using postgres user(-u) with create user command. No you are not at root for the OS you are at OS user postgres connecting as database user testuser. Error screenshots are a

Re: error on connecting port 5432

2020-12-01 Thread Tom Lane
Atul Kumar writes: > Just to clarify that I am at root OS user, trying to create a test user > using postgres user(-u) with create user command. Given the reference to /var/run/postgresql, I'm suspecting that you are running a server that thinks it should put its socket in /tmp, but you have some

Re: error on connecting port 5432

2020-12-01 Thread Atul Kumar
Hi, Just to clarify that I am at root OS user, trying to create a test user using postgres user(-u) with create user command. Error screenshots are already shared with you. Please re-check the same. Regards Atul On Tuesday, December 1, 2020, Adrian Klaver wrote: > On 12/1/20 12:51 AM,

Re: error on connecting port 5432

2020-12-01 Thread Adrian Klaver
On 12/1/20 6:26 AM, Adrian Klaver wrote: On 12/1/20 12:51 AM, Atul Kumar wrote: Hi, When I m creating a test db user using below command using root OS user   sudo -u postgres createuser -p 5432 --pwprompt testuser I am getting the attached error of port. But my postgres services are running

Re: error on connecting port 5432

2020-12-01 Thread Adrian Klaver
On 12/1/20 12:51 AM, Atul Kumar wrote: Hi, When I m creating a test db user using below command using root OS user sudo -u postgres createuser -p 5432 --pwprompt testuser I am getting the attached error of port. But my postgres services are running fine on port 5432, I am sharing the screens