Re: question about /etc/init.d/postgresql in PGDG - Mailing list pgsql-general

From Tom Lane
Subject Re: question about /etc/init.d/postgresql in PGDG
Date
Msg-id 23809.1250699472@sss.pgh.pa.us
Whole thread Raw
In response to question about /etc/init.d/postgresql in PGDG  (Scott Marlowe <scott.marlowe@gmail.com>)
Responses Re: question about /etc/init.d/postgresql in PGDG  (Devrim GÜNDÜZ <devrim@gunduz.org>)
List pgsql-general
Scott Marlowe <scott.marlowe@gmail.com> writes:
> In the init script from the PGDG rpms there's this block of code:

> PGDATA=/var/lib/pgsql/data
> if [ -f "$PGDATA/PG_VERSION" ] && [ -d "$PGDATA/base/template1" ]
> then
>         echo "Using old-style directory structure"
> else
>         PGDATA=/var/lib/pgsql/data
> fi

> Is it just me, or is the else extra noise?  Just wondering if there's
> a reason a config variable is in two places at once.

In the original coding, the first assignment was

PGDATA=/var/lib/pgsql

and thus the if-test did indeed do something useful with setting PGDATA
differently in the two cases.  However, there is no reason whatsoever
for this initscript to be prepared to work with postmaster versions that
would be old enough for the if-test to succeed.  I took the whole
if-block out of the just-updated Fedora RPMs, and would recommend the
same for PGDG.

            regards, tom lane


pgsql-general by date:

Previous
From: Clemens Schwaighofer
Date:
Subject: Re: Postgre RAISE NOTICE and PHP
Next
From: Seth Gordon
Date:
Subject: Re: "Could not open relation XXX: No such file or directory"