Re: Re: [DOCS] Docs incorrectly claiming equivalence between show and pg_settings

From: Stefan Seifert <nine(at)detonation(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Bruce Momjian <bruce(at)momjian(dot)us>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Re: [DOCS] Docs incorrectly claiming equivalence between show and pg_settings
Date: 2014-04-19 19:08:30
Message-ID: 1674217.XTI7CnVsO0@sphinx
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs pgsql-hackers

On Saturday 19 April 2014 13:38:16 Tom Lane wrote:

> > 3 document this restriction
>
> As for (3), I might be wrong, but I don't think the documentation mentions
> the possibility of abusing SET this way at all. Restrictions in
> undocumented quasi-features are likewise undocumented.

http://www.postgresql.org/docs/devel/static/runtime-config-custom.html
states: "Because custom options may need to be set in processes that have not
loaded the relevant extension module, PostgreSQL will accept a setting for any
two-part parameter name."
So I'd say the possibility of using SET this way is somewha documented. That's
at least how I actually got the idea of doing that.

Maybe it can help if I describe our use case: we have some plperlu stored
procedures and triggers that use them that replicate specific data from our
internal management application's database to the system on our webserver.
When running the application's test suite though we obviously don't want that
and instead want it to replicate to another local database, so we can test the
triggers as well. We use a custom option set by our test suite to communicate
the required change in replication target to the stored procedure. As a nice
side effect we can use the same mechanism to prevent a test sandbox version of
the application from trying to replicate to the webserver.

So far this works quite well except for the SHOW command throwing an exception
when we request an unknown configuration parameter complicating our stored
procedure a little. It would be more comfortable if we could query pg_settings
and just get an empty result if the configuration parameter is not set.

Regards,
Stefan

In response to

Browse pgsql-docs by date

  From Date Subject
Next Message Bruce Momjian 2014-04-22 21:54:54 Re: Patch for CREATE RULE sgml -- Was in: [DOCS]
Previous Message Bruce Momjian 2014-04-19 19:00:11 Re: archive_command vs recovery_command paths

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2014-04-19 19:35:42 Re: Avoiding deeply nested AND/OR trees in the parser
Previous Message Bruce Momjian 2014-04-19 18:35:33 Re: Re: [DOCS] Docs incorrectly claiming equivalence between show and pg_settings