Subject: Is that possible to set PGDATA at run time?

From: [email-masked] (Toncan Duong)
Date: Mon, 11 Jul 1994 14:53:17 +1000 (EST)

Hi,

Is that possible to set the PGDATA at run-time?

What we want to achieve is to run the postgres backend/frontend at a
machine different from the machine where the data directory is stored.

It appears that excutables such as monitor, createdb, createuser, etc. 
read/write to the directory that has been set at compilation.

(Went through the manual of 4.2. Haven't found any info. on the setting
of environment variables like PGDATA.)

thanks in advance

[email-masked]

==============================================================================
   To add/remove yourself to/from the POSTGRES mailing list: send mail with 
   the subject line ADD or DEL to "[email-masked]"

   If this fails, send mail to "[email-masked]" and
   a human will deal with it.  DO NOT post to the "postgres" mailing list.
==============================================================================

---

From: [email-masked] (Paul M. Aoki)
Date: Mon, 11 Jul 94 01:03:15 -0700

> Is that possible to set the PGDATA at run-time?

it depends on what you mean by "run-time."  it only matters when 
running the initialization utilities (initdb, newbki, cleardbdir),
which are only run while installing the system, and the postmaster.
none of the other programs look at it.

> machine different from the machine where the data directory is stored.

backends always run on the same machine as the postmaster, because
they are child processes of the postmaster.  the postmaster must be 
started on the machine where the data files are located.

the frontend can be on any machine.

(the process architecture is explained in the user manual..)

> read/write to the directory that has been set at compilation.

no.  the backend servers started by those commands use the 
directory set at compilation, unless the postmaster was started
with PGDATA set to a different directory (or with the -D option).

> of environment variables like PGDATA.)

there isn't much to explain about PGDATA since, after the data
directory has been initialized, it is only used by the postmaster.
look at the "postmaster" man page.  there's also a brief mention
in the user manual.
--
  Paul M. Aoki  |  CS Div., Dept. of EECS, UCB  |  [email-masked]
                |  Berkeley, CA 94720-1776      |  ...!uunet!ucbvax!aoki