Thread: Postgresql.conf, initdb patch

Postgresql.conf, initdb patch

From
Josh Berkus
Date:
Folks,

Attached are 2 patches:

postgresql.conf.patch re-orders postgresql.conf.sample according to the order
patched into runtime.sgml last week.

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!"

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

--
-Josh Berkus
 Aglio Database Solutions
 San Francisco

Attachment

Re: Postgresql.conf, initdb patch

From
Tom Lane
Date:
Josh Berkus <josh@agliodbs.com> writes:
> postgresql.conf.patch re-orders postgresql.conf.sample according to the ord=
> er=20
> patched into runtime.sgml last week.

I've probably already broken this patch by modifying .conf.sample :-(.
Will take care of the cleanup.

BTW, now that I look more closely at the new docs, there are some
classifications that seem pretty bizarre.  For instance,
CLIENT_MIN_MESSAGES has nothing to do with the server log and doesn't
seem to belong in a section about logging ...

            regards, tom lane

Re: Postgresql.conf, initdb patch

From
Josh Berkus
Date:
Tom,

> BTW, now that I look more closely at the new docs, there are some
> classifications that seem pretty bizarre.  For instance,
> CLIENT_MIN_MESSAGES has nothing to do with the server log and doesn't
> seem to belong in a section about logging ...

Would have been nice if someone had mentioned it before.   I posted the sample
order previously; I don't necessarily understand all of the options
correctly.

What is CLIENT_MIN_MESSAGES for, then?

--
-Josh Berkus
 Aglio Database Solutions
 San Francisco


Re: Postgresql.conf, initdb patch

From
Tom Lane
Date:
Josh Berkus <josh@agliodbs.com> writes:
> What is CLIENT_MIN_MESSAGES for, then?

Controls which messages get sent to the client.

            regards, tom lane

Re: Postgresql.conf, initdb patch

From
Josh Berkus
Date:
Tom,

> > What is CLIENT_MIN_MESSAGES for, then?
>
> Controls which messages get sent to the client.

So, I should put it under "Client Connection Defaults", then?

--
-Josh Berkus

______AGLIO DATABASE SOLUTIONS___________________________
                                        Josh Berkus
   Complete information technology     josh@agliodbs.com
    and data management solutions     (415) 565-7293
   for law firms, small businesses      fax 621-2533
    and non-profit organizations.     San Francisco


Re: Postgresql.conf, initdb patch

From
Tom Lane
Date:
> So, I should put it under "Client Connection Defaults", then?

Probably.  But then you have to figure out what to do with the list of
values that it shares with server_min_messages.

Another tack is to change the section title to something more
inclusive.  Maybe "Error Reporting and Logging"?

            regards, tom lane

Re: Postgresql.conf, initdb patch

From
Josh Berkus
Date:
Tom,

> Another tack is to change the section title to something more
> inclusive.  Maybe "Error Reporting and Logging"?

Sounds good to me.  Shall we apply the patch I just submitted, and then I'll
submit a patch for both runtime.sgml and postgresql.conf.sample?

--
-Josh Berkus

______AGLIO DATABASE SOLUTIONS___________________________
                                        Josh Berkus
   Complete information technology     josh@agliodbs.com
    and data management solutions     (415) 565-7293
   for law firms, small businesses      fax 621-2533
    and non-profit organizations.     San Francisco


Re: Postgresql.conf, initdb patch

From
Tom Lane
Date:
Josh Berkus <josh@agliodbs.com> writes:
>> Another tack is to change the section title to something more
>> inclusive.  Maybe "Error Reporting and Logging"?

> Sounds good to me.  Shall we apply the patch I just submitted, and then I'll
> submit a patch for both runtime.sgml and postgresql.conf.sample?

I can fold that in while I'm doing the other stuff...

            regards, tom lane

Re: Postgresql.conf, initdb patch

From
Peter Eisentraut
Date:
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


Re: Postgresql.conf, initdb patch

From
Shridhar Daithankar
Date:
On Tuesday 01 July 2003 05:39, Peter Eisentraut wrote:
> 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.

Argh. That was me who did that patch and it was not good.

Anyway attached is the patch

 * Which uses sed correctly
 * and get rid of temp files at all.

Hopefully this will be good enough.

 Shridhar

Attachment