Lexically-scoped options - Mailing list pgsql-hackers

From Chapman Flack
Subject Lexically-scoped options
Date
Msg-id 5AAEAE0F.20006@anastigmatix.net
Whole thread Raw
List pgsql-hackers
The SQL standard overloads WITH in a query to supply not only CTEs
but also lexically-scoped option settings:

 WITH XMLBINARY BASE64, foo(bar) AS (VALUES('\xDEADBEEF'::bytea))
 SELECT XMLELEMENT(name foo, XMLATTRIBUTES(bar)) FROM foo;

PG already implements XMLBINARY and XMLOPTION using the GUC system.
Would it be easy or hard, reasonable or objectionable, to generalize
PG's WITH syntax along these lines, rewriting it into lexically-scoped
settings of GUCs?

Perhaps a further development in the same line would be enabling the planner
to choose among IMMUTABLE specializations of a function, as well as a
generic STABLE version that depends on a GUC.

-Chap


pgsql-hackers by date:

Previous
From: Christos Maris
Date:
Subject: Re: Google Summer of Code: Potential Applicant
Next
From: Andres Freund
Date:
Subject: include/pgtar.h is missing include guards?