Forum OpenACS Q&A: /etc/postgresql/postgresql.env: No such file or directory

I erased the directory /etc/postgresql and now I get this error message every time I run a pgsql command.

yabt@desktop:~$ psql -l

/usr/lib/postgresql/bin/readpgenv: line 2: /etc/postgresql/postgresql.env: No such file or directory

List of databases

Name | Owner | Encoding

-----------+----------+----------

template0 | postgres | LATIN1

template1 | postgres | LATIN1

yabt | yabt | UNICODE

(3 rows)

Does anybody know what packages I should apt-get install to have the directory and file the place again?

iuri

When I need to find which Debian package contains a file, I go to http://packages.debian.org

Scroll down to the bottom of the page and enter the filename in the 'Search the contents of packages' form.

Sorry i didn't mention everything. I already reinstall postgresql debian pck. But it seems the /etc directory is created with one of the kernels package. I don;t know.

I tried to search by the file was missing but i dind;t get anything

Hi Iuri,

I searched for "/etc/postgresql/postgresql.env debian" from postgreql.org and found this, which might help:

http://archives.postgresql.org/pgsql-admin/2005-09/msg00191.php

Before doing these, realize and know they are -extreme- actions which you normally should not do... and if you don't know how, you need someone who does to help you.

First, back up the whole data directory (you will have to find out where and how).

Next, purge the postgresql package (which removes config files and possibly database)

Then, install postgresql again

Finally, stop postgresql, remove the existing data directory, restore the backup of the data directlry and restart postgresql

That -might- solve your problem.

that;s what i did when i said that i had tried to reinstall postgres
the aptget does not install the directory /etc/postgresql

I believe it comes with the debian distro install

so, does it mean i need to install my debian again??

Iuri, maybe someone with a debian system can answer your question.
yes i did post it on the debian-users mailling list. But nobody answered. :(
anyway I'll keep it posted when i solve this issue
here it is the answer. run apt-get install the package bellow.

http://packages.debian.org/stable/misc/postgresql-client