missing /etc/postgresql/ after uninstall/reinstall

Bug #108296 reported by Uqbar
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
postgresql-8.2 (Ubuntu)
Invalid
Undecided
Unassigned
postgresql-8.4 (Ubuntu)
Invalid
Undecided
Unassigned
postgresql-common (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

Binary package hint: postgresql

I have uninstalled postgresql-8.1 by mistake but after the re-installation the /etc/postgresql/ directory is missing.
Apparently there's no package that will install that directory.
Any hint?

Revision history for this message
Uqbar (uqbar) wrote :

Also /var/lib/postgresql/ is empty.

Revision history for this message
Uqbar (uqbar) wrote :

I've fixed the problem by manually reinstalling all postgresql related packages.
I've seen that no .deb package contains that directory so it must be created by the installation scripts.
I have no idea which one created it but I'd say that either the postgresql-common or the postgresql-server should do the "magics",

Uqbar (uqbar)
Changed in postgresql:
assignee: nobody → vincenzo-romano
status: Unconfirmed → Rejected
William Grant (wgrant)
Changed in postgresql-8.2:
assignee: vincenzo-romano → nobody
Revision history for this message
xdude (uniqus) wrote :

I have the same problem with postgresql-8.2 on feisty, and I cannot solve this whatever packages I remove/install/reinstall. Directory /ets/postgresql is not created at all, and directory /var/lib/postgresql is created empty. And "/etc/init.d/postgresql-8.2 start" just fails and says nothing. I had a brief look through some scripts in /usr/share/postgresql-common/ and found out that some files are required under /etc/postgresql/8.2/, but I do not know and can not find out what data they should contain. Please help, I do not want to reinstall the whole system just because of one single package, I already spent a lot of time with it configuring tons of drivers, software and so on.

Revision history for this message
Kevin Hunter (hunteke) wrote :

After uninstalling 8.1 and installing 8.2, I find that the init.d script does me no good. After some snooping, it appears that this is because I have no DB data, but I did for 8.1. Seems that rather than the script just silently exiting, at least an explanation of /why/ it exited would have saved me 5-10 minutes of scratching my head. On the other hand, I'll bet that the "proper" procedure was to have them both installed side by side, migrate, then uninstall?

Revision history for this message
Barthelemy D. (bart-cs) wrote :

Hi guys,

I had exactly the same problem and solved it by purging (instead of just uninstalling or removing) the postgresql-8.2.

Now everything works fine: the /etc/postgresql has been created along with the startup script.

I don't think the difference between remove and purge is obvious and this should be addressed as a more general problem.

Revision history for this message
Martin Pitt (pitti) wrote :

If you remove the package, the existing databases (and thus /etc/postgresql/<version>/<cluster> are kept, and reinstalling it will work.

If you purge, /etc/postgresql will go away, but then that's what you asked for. The directory is called by pg_createcluster, which is used in the postinst script to create a default 'main' cluster, unless another one exists already or the package is upgraded (not installed freshly).

Changed in postgresql:
status: New → Invalid
Revision history for this message
Uqbar (uqbar) wrote :

Well, but after all, after the re-installation the /etc/postgresql/ directory is missing.
I would expect it to be either kept after an unistall+install or recreated from scratch after a purge+install.
Or am I missing something else?

Revision history for this message
Arne Nordmann (launchpad-norro) wrote :

I am expriencing the same problem. After first installation, directory /etc/postgresql/ is missing.
purge+install doesn't help.
Using karmic, postgresql-8.4_8.4.1-1_amd64

Revision history for this message
Arne Nordmann (launchpad-norro) wrote :

Purging the postgresql package _and_ all the installed dependencies helped. After that reinstallation created the directory /etc/postgresql/

> aptitude purge postgresql libpq5 libreadline5 postgresql-8.4 postgresql-client-8.4 postgresql-client-common postgresql-common
> aptitude install postgresql

Revision history for this message
joschi (jochen+launchpad-schalanda) wrote :

I experienced the same problem with postgresql-8.4 on Ubuntu 9.10 and Ubuntu 10.04.

After purging postgresql-8.4 and removing the configuration directory /etc/postgresql/, it is not recreated when the package postgresql-8.4 is installed again.

Only removing the user/group "postgres", the directory /var/lib/postgresql/ and running "dpkg -P" on the PostgreSQL packages helped.

IMHO this should be fixed and not be marked as invalid.

I understand the point made by Martin Pitt in comment #7, but I disagree: It would be perfectly sensible if this problem occurred after removing postgresql-8.4 instead of purging it. But purging a package should revert to a state in which a simple `aptitude install <package>` installs the respective files which are needed for the package to run properly.

Revision history for this message
Jordon Bedwell (envygeeks) wrote :

Hello Joschi

dpkg -P is a purge. If a package is being uninstalled by apt, synaptics or aptitude and does not properly purge the files, you should file a bug against the respective package manager instead of against postgresql. Thanks for taking the time to help make Ubuntu better.

Changed in postgresql-8.4 (Ubuntu):
status: New → Invalid
Revision history for this message
joschi (jochen+launchpad-schalanda) wrote :

Hello Jordon,

I beg to differ.

In Debian packages, creating and removing users is the task of the pre-/post-scripts of the package and not the task of DPKG.

If the problem was only that /var/lib/postgresql still existed after purging the postgresql-8.4 package, I'd be completely with you, but it looks like it's a problem with the postgresql-8.4 package itself (or more precisely the postrm script).

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.