Running Postmaster - PGDATA Variable

Started by Mike Cover 24 years ago4 messagesgeneral
Jump to latest
#1Mike C
mike@stonebow.otago.ac.nz

Hi,

You must specify the directory that contains the database system either by specifying the -D >invocation option or by setting the PGDATA environment variable.

Where can I set this variable so I don't get this message all the time. I did type

[localhost:/usr/local] postgres% postmaster -D /usr/local/pgsql/data but got this message:
Lock file "/usr/local/pgsql/data/postmaster.pid" already exists.
--

Regards
Mike C

#2Lee Harr
missive@frontiernet.net
In reply to: Mike C (#1)
Re: Running Postmaster - PGDATA Variable

On Thu, 26 Jul 2001 23:47:34 +0000 (UTC), Mike C <mike@stonebow.otago.ac.nz>:

Hi,

You must specify the directory that contains the database system either by specifying the -D >invocation option or by setting the PGDATA environment variable.

Where can I set this variable so I don't get this message all the time. I did type

[localhost:/usr/local] postgres% postmaster -D /usr/local/pgsql/data but got this message:
Lock file "/usr/local/pgsql/data/postmaster.pid" already exists.
--

You would set the PGDATA variable in your shell initialization file
(might be .cshrc or .profile for instance) see the documentation for
your shell on how to set the variable.

If you are absolutely sure that there is not another postmaster
still running you can remove the postmaster.pid file

The file may have been left there if you killed the postmaster
without shutting down properly (like if the power went out on
your computer.)

#3Martijn van Oosterhout
kleptog@svana.org
In reply to: Lee Harr (#2)
Re: Re: Running Postmaster - PGDATA Variable

On Fri, Jul 27, 2001 at 12:28:25AM +0000, Lee Harr wrote:

Lock file "/usr/local/pgsql/data/postmaster.pid" already exists.

If you are absolutely sure that there is not another postmaster
still running you can remove the postmaster.pid file

The file may have been left there if you killed the postmaster
without shutting down properly (like if the power went out on
your computer.)

Can't postgres check to see if the pid listed in that file is still active?
If it is then you can say so, if not then (unless the data is shared out and
there's a postmaster running elsewhere) it's fine to delete it.

--
Martijn van Oosterhout <kleptog@svana.org>
http://svana.org/kleptog/

Show quoted text

It would be nice if someone came up with a certification system that
actually separated those who can barely regurgitate what they crammed over
the last few weeks from those who command secret ninja networking powers.

#4Tom Lane
tgl@sss.pgh.pa.us
In reply to: Martijn van Oosterhout (#3)
Re: Re: Running Postmaster - PGDATA Variable

Martijn van Oosterhout <kleptog@svana.org> writes:

Can't postgres check to see if the pid listed in that file is still active?

It does, at least in recent releases ...

regards, tom lane