Re: Initial review of xslt with no limits patch

Поиск
Список
Период
Сортировка
От David E. Wheeler
Тема Re: Initial review of xslt with no limits patch
Дата
Msg-id 6C783A4D-A729-44B5-97D5-1A5192F70961@kineticode.com
обсуждение исходный текст
Ответ на Re: Initial review of xslt with no limits patch  (Pavel Stehule <pavel.stehule@gmail.com>)
Ответы Re: Initial review of xslt with no limits patch  (Pavel Stehule <pavel.stehule@gmail.com>)
Список pgsql-hackers
On Aug 6, 2010, at 10:15 PM, Pavel Stehule wrote:

>> 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

Huh? You can select into an array:

try=# create table foo(k text, v text);
CREATE TABLE
try=# insert into foo values ('foo', 'bar'), ('baz', 'yow');
INSERT 0 2
try=# select ARRAY[k,v] FROM foo;  array
-----------{foo,bar}{baz,yow}
(2 rows)

try=# select ARRAY(SELECT ARRAY[k,v] FROM foo);
ERROR:  could not find array type for datatype text[]

Okay, so nested arrays are harder.

> b) it expects so all values has same types - what is usually what we
> need, but not necessary

The XML interface converts them all to text anyway, no?

> 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

I agree that it's not as sugary as pairs would be. But I admit to having no problem with
 SELECT foo(ARRAY[ ['foo', 'bar'], ['baz', 'yow']]);

But maybe I'm biased, since there's a lot of that sort of syntax in pgTAP.

Best,

David




В списке pgsql-hackers по дате отправления:

Предыдущее
От: "David E. Wheeler"
Дата:
Сообщение: Re: Initial review of xslt with no limits patch
Следующее
От: Pavel Stehule
Дата:
Сообщение: Re: Initial review of xslt with no limits patch