Lexically-scoped options

From: Chapman Flack <chap(at)anastigmatix(dot)net>
To: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Lexically-scoped options
Date: 2018-03-18 18:21:03
Message-ID: 5AAEAE0F.20006@anastigmatix.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2018-03-18 19:24:07 include/pgtar.h is missing include guards?
Previous Message Christos Maris 2018-03-18 17:58:26 Re: Google Summer of Code: Potential Applicant