Re: show() function - Mailing list pgsql-patches

From Peter Eisentraut
Subject Re: show() function
Date
Msg-id Pine.LNX.4.44.0206261834430.838-100000@localhost.localdomain
Whole thread Raw
In response to Re: show() function  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: show() function
List pgsql-patches
Tom Lane writes:

> I was actually alluding to the possibility of a *writable* table, eg
>
>     UPDATE pg_settings SET value = 'true' WHERE name = 'debug_print_query';
>
> as a query-language equivalent of
>
>     SET debug_print_query = true;

I think this can be done with a stored procedure.  Magic tables with
side-effects seem weird.

Is there anything fundamentally difficult with supporting "PROCEDURE
foo()" as equivalent with "FUNCTION foo() RETURNS opaque" and "CALL foo()"
as equivalent with "SELECT foo()" and throw away the result.  Then you
could define a function analogous to SHOW and a procedure analogous to SET
and can manipulate the values using the full expression language.

--
Peter Eisentraut   peter_e@gmx.net




pgsql-patches by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: show() function
Next
From: Bruce Momjian
Date:
Subject: Re: several minor cleanups