Re: Postgresql.conf, initdb patch - Mailing list pgsql-patches

From Peter Eisentraut
Subject Re: Postgresql.conf, initdb patch
Date
Msg-id Pine.LNX.4.44.0307010140270.3958-100000@peter.localdomain
Whole thread Raw
In response to Postgresql.conf, initdb patch  (Josh Berkus <josh@agliodbs.com>)
Responses Re: Postgresql.conf, initdb patch
List pgsql-patches
Josh Berkus writes:

> initdb.patch, written by Shridhar, patches initdb so that the LC_*
> localization variables are inserted into postgresql.conf at the point
> commented "#LC VARS GO HERE!"

It's pretty pointless to use

cat $file | sed 's/.../'

because sed can open files perfectly well:

sed 's/.../' $file

You should clean up the temp files in exit_nicely(), because if someone or
something aborts initdb in the middle, then the trap will at least have a
better chance to remove the files.

Actually, I doubt that it's safe and/or polite to write temporary files in
the current directory.  If you want to see a better way to handle
temporary files in shell scripts, look in configure near occurences of
'mktemp'.

> As I'm not great a patch-making, I've also attached the completed
> postgresql.conf.sample for reference.

Use diff -c instead of plain diff and put the old file first and the new
file second.

--
Peter Eisentraut   peter_e@gmx.net


pgsql-patches by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: Datetime patch
Next
From: Peter Eisentraut
Date:
Subject: Re: Patch for listing runtime option details through server