Re: Append to a GUC parameter ? - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: Append to a GUC parameter ?
Date
Msg-id 20140806012513.GE9388@eldon.alvh.no-ip.org
Whole thread Raw
In response to Re: Append to a GUC parameter ?  (David G Johnston <david.g.johnston@gmail.com>)
List pgsql-hackers
David G Johnston wrote:
> Alvaro Herrera-9 wrote

> > I think this merits a new GUC flag, say GUC_LIST_ADDITIVE.
> 
> Would that allow, without any special syntax, multiple declarations of, say,
> shared_preload_libraries, to have their values appended instead of the most
> (or least, I forget which) recent one overwrite (or be ignored by) the
> existing value?
> 
> The idea of requiring "+=" instead of just "=" is not particularly
> appealing...

I'm not sold on += as the syntax to use.  It just needs to be something
different from =.  But I am thinking that whatever it is, it would be
required.  Otherwise, for example if you have search_path=foo in
postgresql.conf and search_path=bar in auto.conf via ALTER SYSTEM, you
would end up with search_path=foo,bar instead of just bar which I think
would be the expected outcome.  Of course, we would offer a new ALTER
SYSTEM option to indicate that you want to have auto.conf use += instead
of =.

The idea behing GUC_LIST_ADDITIVE is that += is only supported for
variables that have that flag set.  If you tried to use += with other
variables, an error would be raised.

-- 
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Append to a GUC parameter ?
Next
From: Claudio Freire
Date:
Subject: Re: Proposal: Incremental Backup