Thread: pg_config : postgresql.conf adjustments?

pg_config : postgresql.conf adjustments?

From
Justin Clift
Date:
Hi all,

Would it be beneficial for us to extend "pg_config" to update the
postgresql.conf file?

i.e.

pg_config --sort_mem 16384 --shared_buffers 800

pg_config -d /some/datadir --sort_mem 16384 --shared_buffers 800

etc?

Not sure if it should trigger a restart of postmaster, etc, but the
concept sounds useful.

:-)

Regards and best wishes,

Justin Clift

-- 
"My grandfather once told me that there are two kinds of people: those
who work and those who take the credit. He told me to try to be in the
first group; there was less competition there."  - Indira Gandhi


Re: pg_config : postgresql.conf adjustments?

From
Peter Eisentraut
Date:
Justin Clift writes:

> Would it be beneficial for us to extend "pg_config" to update the
> postgresql.conf file?

That has nothing to do with pg_config's functions.

-- 
Peter Eisentraut   peter_e@gmx.net



Re: pg_config : postgresql.conf adjustments?

From
Justin Clift
Date:
Peter Eisentraut wrote:
> 
> Justin Clift writes:
> 
> > Would it be beneficial for us to extend "pg_config" to update the
> > postgresql.conf file?
> 
> That has nothing to do with pg_config's functions.

At present, sure.  Was thinking a tool for command line changes of
postgresql.conf parameters would be useful, then thought about what such
a tool would be named.  "pg_cfg" was a thought, as was "pg_config".

However we already have a pg_config.  At present it's purpose is in the
realm of reporting the installation configuration of PostgreSQL.  Was
thinking that adding the ability to do more than "report" stuff, but
also to "make changes" isn't that bad an idea.

?

Regards and best wishes,

Justin Clift
> --
> Peter Eisentraut   peter_e@gmx.net

-- 
"My grandfather once told me that there are two kinds of people: those
who work and those who take the credit. He told me to try to be in the
first group; there was less competition there."  - Indira Gandhi


Re: pg_config : postgresql.conf adjustments?

From
Tom Lane
Date:
Justin Clift <justin@postgresql.org> writes:
> Would it be beneficial for us to extend "pg_config" to update the
> postgresql.conf file?

This seems far outside pg_config's charter.  It is a simple
information reporter that can be run by anybody.  Making it able
to mess with (or even look at) postgresql.conf introduces a host
of permissions problems and logistical issues.

I don't really see what's wrong with using a text editor anyway ;-)
        regards, tom lane


Re: pg_config : postgresql.conf adjustments?

From
Alvaro Herrera
Date:
On Sun, 29 Sep 2002, Tom Lane wrote:

> Justin Clift <justin@postgresql.org> writes:
> > Would it be beneficial for us to extend "pg_config" to update the
> > postgresql.conf file?
> 
> This seems far outside pg_config's charter.  It is a simple
> information reporter that can be run by anybody.  Making it able
> to mess with (or even look at) postgresql.conf introduces a host
> of permissions problems and logistical issues.
> 
> I don't really see what's wrong with using a text editor anyway ;-)

Obviously he wants a tool that allows setting parameters from a shell
script or something for use within pg_autotune.  I don't see why it is
bad to have a tool to do this; if someone can use it (and modify
postgresql.conf) obviously he has permission to read (and write)
postgresql.conf.

-- 
Alvaro Herrera (<alvherre[@]dcc.uchile.cl>)
"Hoy es el primer dia del resto de mi vida"



Re: pg_config : postgresql.conf adjustments?

From
Joe Conway
Date:
Alvaro Herrera wrote:
> Obviously he wants a tool that allows setting parameters from a shell
> script or something for use within pg_autotune.  I don't see why it is
> bad to have a tool to do this; if someone can use it (and modify
> postgresql.conf) obviously he has permission to read (and write)
> postgresql.conf.
> 

But, if that's the case, why not just:

1. send e.g. "set sort_mem=8192" as an SQL statement for runtime changeable   parameters
2. use e.g. "pg_ctl restart -D $PGDATA -o '--shared_buffers=10000'" for those   parameters requiring a restart


Joe





Re: pg_config : postgresql.conf adjustments?

From
Justin Clift
Date:
Joe Conway wrote:
> 
> Alvaro Herrera wrote:
> > Obviously he wants a tool that allows setting parameters from a shell
> > script or something for use within pg_autotune.  I don't see why it is
> > bad to have a tool to do this; if someone can use it (and modify
> > postgresql.conf) obviously he has permission to read (and write)
> > postgresql.conf.
> >
> 
> But, if that's the case, why not just:
> 
> 1. send e.g. "set sort_mem=8192" as an SQL statement for runtime changeable
>     parameters
> 2. use e.g. "pg_ctl restart -D $PGDATA -o '--shared_buffers=10000'" for those
>     parameters requiring a restart

Doesn't allow for scriptable permanent changes, only runtime ones.  Was
just trying to think of a "optimal" end user solution.  Totally hadn't
thought of the 'set sort_mem=xxx' option either, but it might work for
the next version of pg_autotune (am going to have to re-write it
anyway).

:)

Regards and best wishes,

Justin Clift

> Joe

-- 
"My grandfather once told me that there are two kinds of people: those
who work and those who take the credit. He told me to try to be in the
first group; there was less competition there."  - Indira Gandhi


Re: pg_config : postgresql.conf adjustments?

From
Tom Lane
Date:
Alvaro Herrera <alvherre@atentus.com> writes:
> On Sun, 29 Sep 2002, Tom Lane wrote:
>> This seems far outside pg_config's charter.

> Obviously he wants a tool that allows setting parameters from a shell
> script or something for use within pg_autotune.  I don't see why it is
> bad to have a tool to do this; if someone can use it (and modify
> postgresql.conf) obviously he has permission to read (and write)
> postgresql.conf.

Well, you could do that with a sed command (twinkle).  But I wasn't
necessarily objecting to the abstract notion of having such a tool ...
I just don't think it's in pg_config's scope.  You could more easily
make a case for adding the functionality to pg_ctl.  Or make a new tool.
        regards, tom lane