From: | Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | "David E(dot) Wheeler" <david(at)kineticode(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, 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-07 05:15:23 |
Message-ID: | AANLkTikGWbKqcGCOJwn1=41MRpBeELAyov+sB=UkppHQ@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
2010/8/7 Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>:
> "David E. Wheeler" <david(at)kineticode(dot)com> writes:
>> I think that some sort of variadic pairs would be useful for this. But since there is no core "ordered pair" data type, I don't think you're going to get too far.
>
> It's not immediately clear to me what an ordered-pair type would get you
> that you don't get with 2-element arrays.
>
> A couple of quick experiments suggest that 2-D arrays might be the thing
> to use. They're easy to construct:
>
> regression=# select array[[1,2],[3,4]];
> array
> ---------------
> {{1,2},{3,4}}
> (1 row)
>
> and you can build them dynamically at need:
>
> regression=# select array[[1,2],[3,4]] || array[5,6];
> ?column?
> ---------------------
> {{1,2},{3,4},{5,6}}
> (1 row)
>
> This is not exactly without precedent, either: our built-in xpath()
> function appears to use precisely this approach for its namespace-list
> argument.
it's one variant, but isn't perfect
a) it expects so key and value are literals
b) it expects so all values has same types - what is usually what we
need, but not necessary
c) isn't too readable - I am sorry so I am repeating - it is same
reason, why people will prefer a VARIADIC function before function
with array - but I can accept, so this is my view of world
Regards
Pavel Stehule
>
> regards, tom lane
>
From | Date | Subject | |
---|---|---|---|
Next Message | David E. Wheeler | 2010-08-07 05:16:06 | Re: Initial review of xslt with no limits patch |
Previous Message | David E. Wheeler | 2010-08-07 05:15:00 | Re: Initial review of xslt with no limits patch |