Hi, Martin,

Martin Pitt schrieb:

>>In the earlier postgresql instalations, one could define environment
>>variables in postgresql.env or postmaster.conf which then were exported
>>to the postmaster, and we could use it as LOCATION when creating new
>>databases in other locations.
> 
> These files are obsolete and ignored in the new infrastructure. The
> current way to move the data directory around is to just do it and
> correct the /etc/postgresql/7.4/main/pgdata symlink.

It is not about the main cluster data directory. It's a kind of "poor
mens tablespace" where one could create a database in a different
directory than its cluster.

http://www.postgresql.org/docs/7.4/interactive/manage-ag-alternate-locs.html
documents this behaviour.

>>dropdb: database removal failed: ERROR:  postmaster environment variable
>>"PGDATAEXTERN" not found
>>Not only that the environment variable setting was not migrated, I also
>>did not find the right place to reinstantiate this setting.
> 
> I see, so you defined PGDATAEXTERN in postgresql.env? What does this
> variable do? It is not documented anywhere and not present in the
> default postgresql.env or postmaster.conf files.

Yes, I defined it in postgresql.env, and then used it in "createdb
--location=PGDATAEXTERN" when creating the database.

I used to have this setting in the init.d scripts, but as an apt-get
upgrade overwrote this file, I was told to use postmaster.env instead. I
don't remember whether there was an official bug filing, or this was
private email.

> I need further information about what you want to do to be able to do
> something about this bug.

As a workaround until all 7.4 databases are migrated, I just want to
know the right place where to hack in this environment variable, so the
postmaster process can access it.

It is interesting that normal database access works, only some commands
like drop database seem to use the environment variable actually.

>>So I'm stuck with either dropping the whole cluster (and thus having to
>>migrate about 50 gig into a new cluster without stopping production
>>environment), or having an empty zombie-database lingering around which
>>confuses users.
> 
> I don't understand; if you have a proper data directory somewhere, you
> can always integrate it in the Debian infrastructure with
> pg_createcluster -d /path/to/data/directory. Can you please elaborate
> about what the problem is?

The problem is that the main data directory for the cluster was properly
migrated (and is the 7.4/main cluster now), but not the database
specific directory.

> Thank you, and 'guten Rutsch'!

Its me who has to say "Thank you".

Ebenfalls einen guten Rutsch und ein erfolgreiches neues Jahr.

Markus

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to