Re: question about /etc/init.d/postgresql in PGDG

From: Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-general(at)postgresql(dot)org, Devrim GÜNDÜZ <devrim(at)gunduz(dot)org>
Subject: Re: question about /etc/init.d/postgresql in PGDG
Date: 2009-08-19 16:34:29
Message-ID: dcc563d10908190934m1068304fl5667445406a9a684@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

2009/8/19 Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>:
> Scott Marlowe <scott(dot)marlowe(at)gmail(dot)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.

The only reason I noticed it was that I was building a server with a
separate /data partition for the db to live in, and went to edit
/etc/init.d/postgresql and was faced with two PGDATA assignments... I
too deleted the entire if else block when faced with it.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Sam Mason 2009-08-19 16:35:05 Re: Monitoring the sequence cycles
Previous Message Tom Lane 2009-08-19 16:31:12 Re: question about /etc/init.d/postgresql in PGDG