Re: Initial review of xslt with no limits patch

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>, Mike Fowler <mike(at)mlfowler(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Initial review of xslt with no limits patch
Date: 2010-08-06 17:46:44
Message-ID: AANLkTin_sC7ootrapLaKVK1W9fzX6dq_xsgaWs4wjTMP@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

2010/8/6 Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>:
> Andrew Dunstan <andrew(at)dunslane(dot)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
>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2010-08-06 17:50:08 Re: including backend ID in relpath of temp rels - updated patch
Previous Message Michael Meskes 2010-08-06 17:22:38 Re: BUG #5607: memmory leak in ecpg