Thread: Postgres not getting logged in from command prompt

Postgres not getting logged in from command prompt

From
Himanshu Joshi
Date:
Hi All,
        I am getting a below mentioned strange error while logging into
postgres from linux command prompt. It is working fine with GUI(pgAdmin
III). I am using postgres version 8.4SS.
Himanshu
# cd /opt/PostgresPlus/8.4SS/
# bin/psql -Upostgres -p
bin/psql: line 1: bzip2,: command not found
bin/psql: line 3: usage:: command not found
bin/psql: line 5: -h: command not found
bin/psql: line 6: -d: command not found
bin/psql: line 7: -z: command not found
bin/psql: line 8: syntax error near unexpected token `('
bin/psql: line 8: `   -k --keep           keep (don't delete) input files'
#

I have already given the restart to postgres as well as the server many
times, but it didnt worked.
Plz suggest any solution for that.

Regards,
Himanshu Joshi



--
View this message in context:
http://postgresql.1045698.n5.nabble.com/Postgres-not-getting-logged-in-from-command-prompt-tp5722379.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.


Re: Postgres not getting logged in from command prompt

From
"Albe Laurenz"
Date:
Himanshu Joshi wrote:
>         I am getting a below mentioned strange error while logging
into
> postgres from linux command prompt. It is working fine with
GUI(pgAdmin
> III). I am using postgres version 8.4SS.
> Himanshu
> # cd /opt/PostgresPlus/8.4SS/
> # bin/psql -Upostgres -p
> bin/psql: line 1: bzip2,: command not found
> bin/psql: line 3: usage:: command not found
> bin/psql: line 5: -h: command not found
> bin/psql: line 6: -d: command not found
> bin/psql: line 7: -z: command not found
> bin/psql: line 8: syntax error near unexpected token `('
> bin/psql: line 8: `   -k --keep           keep (don't delete) input
files'
> #
>
> I have already given the restart to postgres as well as the server
many
> times, but it didnt worked.
> Plz suggest any solution for that.

That looks like bin/psql is not an executable but a text file,
which it should not be.

How did you install PostgreSQL?  What is in that file and how
did it get there?

Maybe reinstalling the PostgreSQL software will help.

Yours,
Laurenz Albe


Re: Postgres not getting logged in from command prompt

From
Magnus Hagander
Date:
On Mon, Sep 3, 2012 at 10:10 AM, Albe Laurenz <laurenz.albe@wien.gv.at> wrote:
> Himanshu Joshi wrote:
>>         I am getting a below mentioned strange error while logging
> into
>> postgres from linux command prompt. It is working fine with
> GUI(pgAdmin
>> III). I am using postgres version 8.4SS.
>> Himanshu
>> # cd /opt/PostgresPlus/8.4SS/
>> # bin/psql -Upostgres -p
>> bin/psql: line 1: bzip2,: command not found
>> bin/psql: line 3: usage:: command not found
>> bin/psql: line 5: -h: command not found
>> bin/psql: line 6: -d: command not found
>> bin/psql: line 7: -z: command not found
>> bin/psql: line 8: syntax error near unexpected token `('
>> bin/psql: line 8: `   -k --keep           keep (don't delete) input
> files'
>> #
>>
>> I have already given the restart to postgres as well as the server
> many
>> times, but it didnt worked.
>> Plz suggest any solution for that.
>
> That looks like bin/psql is not an executable but a text file,
> which it should not be.
>
> How did you install PostgreSQL?  What is in that file and how
> did it get there?

From the paths, it appears to be the EnterpriseDB Postgres Plus
product. You might have better luck trying to ask your question over
in their forums.


--
 Magnus Hagander
 Me: http://www.hagander.net/
 Work: http://www.redpill-linpro.com/


Re: Postgres not getting logged in from command prompt

From
"himanshu.joshi"
Date:
Albe Laurenz wrote:
> Himanshu Joshi wrote:
>
>>         I am getting a below mentioned strange error while logging
>>
> into
>
>> postgres from linux command prompt. It is working fine with
>>
> GUI(pgAdmin
>
>> III). I am using postgres version 8.4SS.
>> Himanshu
>> # cd /opt/PostgresPlus/8.4SS/
>> # bin/psql -Upostgres -p
>> bin/psql: line 1: bzip2,: command not found
>> bin/psql: line 3: usage:: command not found
>> bin/psql: line 5: -h: command not found
>> bin/psql: line 6: -d: command not found
>> bin/psql: line 7: -z: command not found
>> bin/psql: line 8: syntax error near unexpected token `('
>> bin/psql: line 8: `   -k --keep           keep (don't delete) input
>>
> files'
>
>> #
>>
>> I have already given the restart to postgres as well as the server
>>
> many
>
>> times, but it didnt worked.
>> Plz suggest any solution for that.
>>
>
> That looks like bin/psql is not an executable but a text file,
> which it should not be.
>
> How did you install PostgreSQL?  What is in that file and how
> did it get there?
>
> Maybe reinstalling the PostgreSQL software will help.
>
> Yours,
> Laurenz Albe
>
Hi Laurenz,
    You were right. bin/psql was overwritten as a text file. I have
replaced this corrupted bin/psql file with bin/psql file from another
server. So now the postgres it is working fine.
Thanks for your valuable suggestion.

Regards
Himanshu Joshi