Re: Alternate database locations

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Charlie Toohey <ctoohey(at)pacbell(dot)net>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: Alternate database locations
Date: 2002-04-18 03:51:30
Message-ID: 5930.1019101890@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Charlie Toohey <ctoohey(at)pacbell(dot)net> writes:
> 1. Since the pg_ctl -D option only appears to take a single location, should
> this be set to the location of the template1 database created as part of the
> Postgres installation, or, do I have to somehow specify the location of each
> of my databases in alternate locations when starting Postgres ?

-D points at the root of the data directory, a/k/a $PGDATA. This is
where postgresql.conf and some other installation-wide files live.
Individual databases are normally subdirectories under $PGDATA/base/,
but can be relocated elsewhere using the "alternate database location"
mechanism.

> I am using the startup script from the contrib/start-scripts/linux directory
> of PostgreSQL source (v. 7.1.3), so I define an environment variable within
> this file, prior to the command to start the server --- let's say it is
> defined as :
> PGDATA_ALTERNATE="/home/alternate/pgsql/data"

I think you also need "export PGDATA_ALTERNATE"; otherwise it's only a
local variable in that shell script.

regards, tom lane

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Makarov Gera x8521 2002-04-18 05:24:32 Migrating Oracle to PostgreSQL
Previous Message Tom Lane 2002-04-18 03:47:13 Re: Connection terminates but postmaster proc lives on...?