potential bug! hardcoded location of data files - Mailing list pgsql-general

From jim@reptiles.org (Jim Mercer)
Subject potential bug! hardcoded location of data files
Date
Msg-id m120HnP-00080yC@mailbox.reptiles.org
Whole thread Raw
List pgsql-general
i started out with a normal installation where the PGDATA dir was
/usr/local/pgsql/data

the database grew, so i created /data/pgsql/data, moved the data and symlinked
/usr/local/pgsql/data to point to /data/pgsql/data.

at some point, i changed the PGDATA env var in ~pgsql/.profile to be
/data/pgsql/data, hence when the postmaster started up, the PGDATA env var
supposedly overrode the -D flag.
(my pgsql.sh rc startup file sources ~pgsql/.profile)

time moves on, and i jiggled the disk around, and actually mounted a RAID
array as /usr/local/pgsql/data.

in that process, i added a symlink pointing /data/pgsql/data back to
/usr/local/pgsql/data.

i then updated ~pgsql/.profile to have PGDATA using /usr/local/pgsql/data
once again.

i nuked the /data/pgsql/data symlink, figuring that both PGDATA and -D
both pointed to /usr/local/pgsql/data.

my applications, which insert piles of records into several tables went fine.

for about 6 hours.

then the nightly job fired up, halted the insert processes, and attempted to
vacuum the database.

well, things got highly unpleasant.

the normal vacuum on the main table crashed with a message saying the backend
was gone.

i killed and restarted the postmaster, and couldn't even do a "\dt".

i recompiled and installed (maybe the binaries somehow got icked??).
still vacuum crashed.

figuring something got icky, i su'd to pgsql and attempted to vacuum template1.

crash again.

i thought about what i had done, and thought i'd put back the symlink, pointing
/data/pgsql/data to /usr/local/pgsql/data.

whamo, the vacuums worked fine.

now, it just gets more strange, after vacuuming several tables (but not all
of them), decided to do some dignostics.

i nuked the symlink, and the vacuums worked fine.

so, my questions are:

does something somewhere records the absolute pathname?

does vacuum update this item using PGDATA?

why are absolute pathnames stored?

--
[ Jim Mercer                 jim@reptiles.org              +1 416 506-0654 ]
[          Reptilian Research -- Longer Life through Colder Blood          ]
[  Don't be fooled by cheap Finnish imitations; BSD is the One True Code.  ]

pgsql-general by date:

Previous
From: Oliver Fischer
Date:
Subject: Description fo the database catalog
Next
From: Charles Tassell
Date:
Subject: Re: Fw: [GENERAL] Postgres install problem