Re: pg_group_name_index corrupt? - Mailing list pgsql-hackers

From Tatsuo Ishii
Subject Re: pg_group_name_index corrupt?
Date
Msg-id 20000506100102U.t-ishii@sra.co.jp
Whole thread Raw
In response to Re: pg_group_name_index corrupt?  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: pg_group_name_index corrupt?
List pgsql-hackers
> What last startup?  This may be a virgin database we're talking about
> (probably would be, if I get my way about not using a postmaster at
> all during pg_upgrade).  More to the point, people who are using
> system-boot-time scripts to start postgres may expect their postmasters
> to be started in a different environment than what pg_ctl would produce.
> (Just because pg_ctl is available is not a good reason to assume that
> people are using it, particularly not existing dbadmins who will have
> developed their own procedures.)
> 
> The environment issue is potentially a pretty nasty gotcha; you'll
> recall the problem reports we've heard in the past that turned out to
> trace to different settings of LOCALE or whathaveyou between postmasters
> started by hand and postmasters started by scripts.  Also, IIRC, pg_ctl
> doesn't currently support sending the postmaster log anywhere but
> /dev/null, which will annoy at least some people ;-).  One might also
> guess that some sites run their postmasters with higher or lower process
> priority than normal, or several other things that pg_ctl knows nothing
> about.

Tom is right except that pg_ctl sends postmaster log to
/dev/null. pg_ctl actulally does nothing with it. So if postmaster
sends log to stdout, then it is sent to stdout. If postmaster is
invoked with -S option, logs are sent to /dev/null. That all.

BTW, currently the best way to get logs from postmaster woul be
compiling it with USE_SYSLOG (why is this not enabled by configure?),
and sending log to syslog, IMHO. Sending logs to a plain file is just
too dumb, like infinite log file size, to rotate log we have to stop
postmaster...

> So I think it's not really a good idea to wire use of pg_ctl into other
> tools just yet.  Maybe after pg_ctl has been around for a few releases...

Maybe the way we should go is that pg_ctl sends signal to postmaster
and let it restart by itself. This would solve part of the problems
Tom mentioned, at least environment variables ones.

(BTW is it really possible for postmaster to remember its process
priority?)

> As I said, I see no harm in using pg_ctl to *stop* a postmaster, if it
> can do that.

Definitely it can, if the postmaster is 7.0 or later.
--
Tatsuo Ishii


pgsql-hackers by date:

Previous
From: Tatsuo Ishii
Date:
Subject: Re: --enable-locale and SET command ...
Next
From: Vince Vielhaber
Date:
Subject: Re: You're on SecurityFocus.com for the cleartext passwords.