pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Charlie Toohey <ctoohey@pacbell.net>
To: pgsql-admin@postgresql.org
Subject: Alternate database locations
Date: Wed, 17 Apr 2002 11:49:38 -0700
Message-ID: <20020417184938.BFD10475469@postgresql.org> (raw)

I would like to create multiple databases, each with its own disk location.

I have followed the instructions in the Administrator's Guide and have a 
couple of questions.

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 ?

2. As user postgres, I shut down the server, defined the following 
environment variable:
PGDATA_ALTERNATE=/home/alternate/pgsql/data
and ran initlocation:
initlocation PGDATA_ALTERNATE
note: /home/alternate/pgsql/data is writeable by postgres

So far so good.

Now, the problem: Per the Administrator's guide, the environment variable 
needs to be defined before the backend is started.

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"

After starting the server using the script, I switch to user postgres, and I 
issue the following command to create a  database at the alternate location:

createdb -D 'PGDATA_ALTERNATE'

I get the following error:
ERROR:  Postmaster environment variable 'PGDATA_ALTERNATE' not set
createdb: database creation failed

I assumed this environment variable was defined as I put it in the startup 
script (just below the line PGDATA="/usr/local/data/pgsql"). Even if I define 
the PGDATA_ALTERNATE explicitly in the shell, and then run the createdb 
command above, I get the same error.

Any ideas ?

Thanks
Charlie








view thread (11+ messages)  latest in thread

Message-ID: <20020417184938.BFD10475469@postgresql.org>
Permalink:  ../20020417184938.BFD10475469@postgresql.org/
Also on:    postgresql.org/message-id/20020417184938.BFD10475469@postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: ctoohey@pacbell.net
  Subject: Re: Alternate database locations
  In-Reply-To: <20020417184938.BFD10475469@postgresql.org>
  References: <20020417184938.BFD10475469@postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox