Re: Initial review of xslt with no limits patch - Mailing list pgsql-hackers

From Pavel Stehule
Subject Re: Initial review of xslt with no limits patch
Date
Msg-id AANLkTin_sC7ootrapLaKVK1W9fzX6dq_xsgaWs4wjTMP@mail.gmail.com
Whole thread Raw
In response to Re: Initial review of xslt with no limits patch  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Initial review of xslt with no limits patch
Re: Initial review of xslt with no limits patch
List pgsql-hackers
2010/8/6 Tom Lane <tgl@sss.pgh.pa.us>:
> Andrew Dunstan <andrew@dunslane.net> writes:
>> On 08/06/2010 12:15 PM, Tom Lane wrote:
>>> Some examination of
>>> http://www.xmlsoft.org/XSLT/tutorial/libxslttutorial.html
>>> suggests that the parameter values need to be single-quoted,
>>> and indeed when I change the last part of your example to
>>>
>>> 'n1=''v1'',n2=''v2'',n3=''v3'',n4=''v4'',n5=''v5'''::text);
>
>> Which would look a whole lot nicer with dollar quoting ;-)
>
> No doubt.  But one would assume that constant parameters aren't going
> to be the normal use-case, and dollar quoting isn't helpful for
> nonconstant text.
>
> I think there are issues here that we need to take a step back and think
> about.  Right now, thanks to the lack of documentation, we can probably
> assume there are approximately zero users of the xslt_process parameter
> feature.  Once we document it that'll no longer be true.  So right now
> would be the time to reflect on whether this is a specification we
> actually like or believe is usable; it'll be too late to change it
> later.
>

I know about one important user from Czech Republic


> There are two specific points bothering me now that I see how it works:
>
> 1. name = value pretty much sucks, especially with the 100% lack of any
> quoting convention for either equals or comma.  I concur with the
> thoughts upthread that turning this into a variadic function would be a
> more sensible solution.

I'll propose a new kind of functions (only position parameter's
function). My idea is simple - for functions with this mark the mixed
and named notation is blocked. But these functions can have a
parameter names - and these names can be passed to function. So there
is possible have a

xslt_process function with current behave - third argument has not
label, and new variadic version like

xslt_process(..,.., param_name1 = 'v1', param_name2 = 'v2',
param_name3 = 'v3', ...)

an implementation of this functionality can be very simple, and we can
use this for xslt_process in 9.1

Regards

Pavel Stehule


>
> 2. I'm not sure whether we ought to auto-single-quote the values.
> If we don't, how hard is it for users to properly quote nonconstant
> parameter values?  (Will quote_literal work, or are the quoting rules
> different for libxslt?)  If we do, are we giving up functionality
> someone cares about?
>
>                        regards, tom lane
>


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: including backend ID in relpath of temp rels - updated patch
Next
From: Robert Haas
Date:
Subject: Re: including backend ID in relpath of temp rels - updated patch