Uz.ytkownik Hugh Esco napisa?:
> Thank you so much, Mallah, Tomasz Myrta, Luis Sousa,
> Achilleus Mantzios, Tom Lane, Bill Eaton and Oliver Elphick.
>
> I have chmod 755 my readpgenv file, and then copied the
> shell script suggested by Tomasz Myrta into that file,
> yielding these results:
>
>> biko:/usr/lib/postgresql/bin# cd /usr/bin
>> biko:/usr/bin# ./psql -U postgres
>> No database specified
It's like it should be.
>> biko:/usr/bin# ./psql -U postgres template1
>> /usr/lib/postgresql/bin/readpgenv: ./etc/postgresql/postgresql.env: No
>> such file
>> or directory
>
>
> How should that file read?
>
>> Could not execv /usr/lib/postgresql/bin/psql
If you still want to fight with your postgres, here is content of my
(it's default) postgresql.env:>>BEGIN<<
[ -r /etc/postgresql/postmaster.conf ] && . /etc/postgresql/postmaster.conf
PGDATA=${POSTGRES_DATA:-/var/lib/postgres/data}
PGLIB=/usr/lib/postgresql/lib
PGACCESS_HOME=/usr/lib/postgresql/share/pgaccess
PGHOST=
export PGLIB PGDATA PGACCESS_HOME PGHOST>>END<<
I think you should just reinstall postgres from .deb package as said Tom
Lane. I had never troubles like yours with default .deb package.
> Then I changed user from root to postgres,
> under which this database had been created:
Psql works also as root, but you should run it as postgres for security
reason.
Tomasz Myrta