Thread: Psql not working

Psql not working

From
"Narendran .j"
Date:
Hello Team,

I'm facing one problem, can't login postgres by psql, even it's not throwing any error and can't find anything in log.

Checked server is running fine, able to check status using pg_ctl. Can can't login through psql

My login attempt 

psql
/usr/pgsql-14/bin/psql
psql -U postgres -p 5432 -d postgres 

When I'm running above query it's return to next line, nothing comes up

Please on this.

Thanks

AW: Psql not working

From
"Dischner, Anton"
Date:

Hi,

 

which user are you?

Check with: id

 

Try something like "su - postgres" before issuing psql command

 

Best,

 

Anton

 

Von: Narendran .j <jnarendran3@gmail.com>
Gesendet: Donnerstag, 12. Dezember 2024 14:31
An: pgsql-admin@lists.postgresql.org
Betreff: Psql not working

 

Hello Team,

 

I'm facing one problem, can't login postgres by psql, even it's not throwing any error and can't find anything in log.

 

Checked server is running fine, able to check status using pg_ctl. Can can't login through psql

 

My login attempt 

 

psql

/usr/pgsql-14/bin/psql

psql -U postgres -p 5432 -d postgres 

 

When I'm running above query it's return to next line, nothing comes up

 

Please on this.

 

Thanks

Re: Psql not working

From
Kashif Zeeshan
Date:
Hi

Can you check which user you are using to run psql,

Do the following
1. Execute ls -lrt /usr/pgsql../bin/psql to see if the user have access to it

2. If you have access then try running the command psql --help to make sure if you have access to psql.

3. Also try to connect with the wrong user / port to see if psql generates error.

Regards
Kashif Zeeshan

On Thu, Dec 12, 2024 at 6:31 PM Narendran .j <jnarendran3@gmail.com> wrote:
Hello Team,

I'm facing one problem, can't login postgres by psql, even it's not throwing any error and can't find anything in log.

Checked server is running fine, able to check status using pg_ctl. Can can't login through psql

My login attempt 

psql
/usr/pgsql-14/bin/psql
psql -U postgres -p 5432 -d postgres 

When I'm running above query it's return to next line, nothing comes up

Please on this.

Thanks

Re: Psql not working

From
"Narendran .j"
Date:
I have checked the user, user is postgres
I have noted that in bin path the size of psql client is 0
psql --version and psql --help not working
so i suspecting the psql client

Regards,
Narendran

On Thu, 12 Dec 2024 at 19:40, Kashif Zeeshan <kashi.zeeshan@gmail.com> wrote:
Hi

Can you check which user you are using to run psql,

Do the following
1. Execute ls -lrt /usr/pgsql../bin/psql to see if the user have access to it

2. If you have access then try running the command psql --help to make sure if you have access to psql.

3. Also try to connect with the wrong user / port to see if psql generates error.

Regards
Kashif Zeeshan

On Thu, Dec 12, 2024 at 6:31 PM Narendran .j <jnarendran3@gmail.com> wrote:
Hello Team,

I'm facing one problem, can't login postgres by psql, even it's not throwing any error and can't find anything in log.

Checked server is running fine, able to check status using pg_ctl. Can can't login through psql

My login attempt 

psql
/usr/pgsql-14/bin/psql
psql -U postgres -p 5432 -d postgres 

When I'm running above query it's return to next line, nothing comes up

Please on this.

Thanks

Re: Psql not working

From
Kashif Zeeshan
Date:


On Thu, Dec 12, 2024 at 7:44 PM Narendran .j <jnarendran3@gmail.com> wrote:
I have checked the user, user is postgres
I have noted that in bin path the size of psql client is 0
psql --version and psql --help not working
so i suspecting the psql client

It means the psql is not properly installed. Try to re-install postgres client again.

Regards,
Narendran

On Thu, 12 Dec 2024 at 19:40, Kashif Zeeshan <kashi.zeeshan@gmail.com> wrote:
Hi

Can you check which user you are using to run psql,

Do the following
1. Execute ls -lrt /usr/pgsql../bin/psql to see if the user have access to it

2. If you have access then try running the command psql --help to make sure if you have access to psql.

3. Also try to connect with the wrong user / port to see if psql generates error.

Regards
Kashif Zeeshan

On Thu, Dec 12, 2024 at 6:31 PM Narendran .j <jnarendran3@gmail.com> wrote:
Hello Team,

I'm facing one problem, can't login postgres by psql, even it's not throwing any error and can't find anything in log.

Checked server is running fine, able to check status using pg_ctl. Can can't login through psql

My login attempt 

psql
/usr/pgsql-14/bin/psql
psql -U postgres -p 5432 -d postgres 

When I'm running above query it's return to next line, nothing comes up

Please on this.

Thanks

Re: Psql not working

From
Rajesh Kumar
Date:

I don't think the size 0 is a problem here.

On Thu, 12 Dec 2024, 20:28 Holger Jakobs, <holger@jakobs.com> wrote:
Am 12.12.24 um 15:44 schrieb Narendran .j:
> I have checked the user, user is postgres
> I have noted that in bin path the size of psql client is 0
> psql --version and psql --help not working
> so i suspecting the psql client
>
> Regards,
> Narendran
>

Try finding psql on your disk with

   find / -xdev -name psql -ls

and check whether one of the files found is an executable with

   file path_of_file

and try it if it is.

Maybe your original psql file was deleted or its length set to zero by
incident. You might as well re-install your client package in order to
repair it.

Regards,
Holger

--

Holger Jakobs, Bergisch Gladbach

Re: Psql not working

From
vignesh kumar
Date:
Re install your client binaries.. could be one potential problem.. 

From: Narendran .j <jnarendran3@gmail.com>
Sent: Thursday, December 12, 2024 7:01:28 PM
To: pgsql-admin@lists.postgresql.org <pgsql-admin@lists.postgresql.org>
Subject: Psql not working
 
Hello Team,

I'm facing one problem, can't login postgres by psql, even it's not throwing any error and can't find anything in log.

Checked server is running fine, able to check status using pg_ctl. Can can't login through psql

My login attempt 

psql
/usr/pgsql-14/bin/psql
psql -U postgres -p 5432 -d postgres 

When I'm running above query it's return to next line, nothing comes up

Please on this.

Thanks

AW: Psql not working

From
"Dischner, Anton"
Date:

Hi,

 

on my system ist:

 

which psql

/usr/bin/psql

postgres@myserver:~$ file /usr/bin/psql

/usr/bin/psql: symbolic link to ../share/postgresql-common/pg_wrapper

file /usr/share/postgresql-common/pg_wrapper

/usr/share/postgresql-common/pg_wrapper: Perl script text executable

 

Regards,

 

Anton

 

Von: Rajesh Kumar <rajeshkumar.dba09@gmail.com>
Gesendet: Donnerstag, 12. Dezember 2024 16:03
An: Holger Jakobs <holger@jakobs.com>
Cc: pgsql-admin@lists.postgresql.org
Betreff: Re: Psql not working

 

I don't think the size 0 is a problem here.

 

On Thu, 12 Dec 2024, 20:28 Holger Jakobs, <holger@jakobs.com> wrote:

Am 12.12.24 um 15:44 schrieb Narendran .j:
> I have checked the user, user is postgres
> I have noted that in bin path the size of psql client is 0
> psql --version and psql --help not working
> so i suspecting the psql client
>
> Regards,
> Narendran
>

Try finding psql on your disk with

   find / -xdev -name psql -ls

and check whether one of the files found is an executable with

   file path_of_file

and try it if it is.

Maybe your original psql file was deleted or its length set to zero by
incident. You might as well re-install your client package in order to
repair it.

Regards,
Holger

--

Holger Jakobs, Bergisch Gladbach