Red Hat Bugzilla – Bug 85919
Upgrading postgresql erased my databases
Last modified: 2007-04-18 12:51:57 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 Galeon/1.2.6 (X11; Linux i686; U;) Gecko/20020830
Description of problem:
I'm not sure whether this counts as a bug or if it's just foolishness on my
part. Anyway I upgraded my postgresql packages on two of my machines using an
'rpm -Fvh *'. After that the databases on one of the machines seems to have
dissapeared. The second machine seems fine though. Both machines had roughly
the exact same postgresql setup so it makes no sense how one is trashed while
the other one isn't.
On the machine the databases disappeared from, if I try and run 'psql template1'
it tells me this:
psql: FATAL 1: Database "template1" does not exist.
The database subdirectory '/var/lib/pgsql/data/base/1' is missing.
The way I understand it the template1 database should always be there no matter
what. And in fact the whole /var/lib/pgsql/data/base directory is missing, not
just a directory under it.
Anyway, like I said, I'm not sure if this counts as a bug or what, but that's
Version-Release number of selected component (if applicable):
Hmm. Can you tell me what packages you upgraded (ie. which ones, specifically)?
Also, is it possible that your data directory was something other than
/var/lib/pgsql with your previous setup and the init script got overwritten?
From what version(s) were you upgrading? And to what?
Darn it, I'm sorry to bother you guys. It turns out that prior to the upgrade
my /var/lib/pgsql directory was actually a link to another location. I still
find it rather odd though that after the upgrade there was no template1 database.
The database location is not initialized until running `/etc/init.d/postgresql
start` (or `service postgresql start`), so unless this was done after the
upgrade (with the link removed), it would not have been created.