Re: location of the configuration files - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: location of the configuration files
Date
Msg-id 200302142217.h1EMHMH15782@candle.pha.pa.us
Whole thread Raw
In response to Re: location of the configuration files  (Kevin Brown <kevin@sysexperts.com>)
List pgsql-hackers
Kevin Brown wrote:
> Bruce Momjian wrote:
> > The big question is whether PGDATA is still our driving config variable,
> > and PGCONFIG/-C is just an additional option, or whether we are moving
> > in a direction where PGCONFIG/-C is going to be the driving value, and
> > data_dir is going to be read as part of that.
>
> I'm actually leaning towards PGCONFIG + PGDATA.
>
> Yeah, it may be a surprise given my previous arguments, but I can't
> help but think that the advantages you get with PGDATA will also exist
> for PGCONFIG.
>
> My previous arguments for removing PGDATA from postmaster can be dealt
> with by fixing pg_ctl to use explicit command line directives when
> invoking postmaster -- no changes to postmaster needed.  PGCONFIG
> would be no different in that regard.

The following patch propogates pg_ctl -D to the postmaster as a -D flag.
I see no other pg_ctl flags that make sense to propogate.

Applied.

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073
Index: src/bin/pg_ctl/pg_ctl.sh
===================================================================
RCS file: /cvsroot/pgsql-server/src/bin/pg_ctl/pg_ctl.sh,v
retrieving revision 1.30
diff -c -c -r1.30 pg_ctl.sh
*** src/bin/pg_ctl/pg_ctl.sh    18 Oct 2002 22:05:35 -0000    1.30
--- src/bin/pg_ctl/pg_ctl.sh    14 Feb 2003 22:04:56 -0000
***************
*** 115,120 ****
--- 115,122 ----
  logfile=
  silence_echo=
  shutdown_mode=smart
+ PGDATAOPTS=""
+ POSTOPTS=""

  while [ "$#" -gt 0 ]
  do
***************
*** 129,135 ****
          ;;
      -D)
          shift
!         # pass environment into new postmaster
          PGDATA="$1"
          export PGDATA
          ;;
--- 131,138 ----
          ;;
      -D)
          shift
!         # we need to do this so -D datadir shows in ps display
!         PGDATAOPTS="-D $1"
          PGDATA="$1"
          export PGDATA
          ;;
***************
*** 333,344 ****
      fi

      if [ -n "$logfile" ]; then
!         "$po_path" ${1+"$@"} </dev/null >>$logfile 2>&1 &
      else
          # when starting without log file, redirect stderr to stdout, so
          # pg_ctl can be invoked with >$logfile and still have pg_ctl's
          # stderr on the terminal.
!         "$po_path" ${1+"$@"} </dev/null 2>&1 &
      fi

      # if had an old lockfile, check to see if we were able to start
--- 336,347 ----
      fi

      if [ -n "$logfile" ]; then
!         "$po_path" ${1+"$@"} ${PGDATAOPTS+$PGDATAOPTS} </dev/null >>$logfile 2>&1 &
      else
          # when starting without log file, redirect stderr to stdout, so
          # pg_ctl can be invoked with >$logfile and still have pg_ctl's
          # stderr on the terminal.
!         "$po_path" ${1+"$@"} ${PGDATAOPTS+$PGDATAOPTS} </dev/null 2>&1 &
      fi

      # if had an old lockfile, check to see if we were able to start

pgsql-hackers by date:

Previous
From: Tilo Schwarz
Date:
Subject: Re: Changing the default configuration (was Re: [pgsql-advocacy]
Next
From: Bruce Momjian
Date:
Subject: Re: client_encoding directive is ignored in postgresql.conf