Re: Proposal: XML helper functions

Поиск
Список
Период
Сортировка
От Scott Bailey
Тема Re: Proposal: XML helper functions
Дата
Msg-id 4B439807.2040707@comcast.net
обсуждение исходный текст
Ответ на Re: Proposal: XML helper functions  (Peter Eisentraut <peter_e@gmx.net>)
Ответы Re: Proposal: XML helper functions  (Peter Eisentraut <peter_e@gmx.net>)
Список pgsql-hackers
Peter Eisentraut wrote:
> On tis, 2010-01-05 at 10:14 -0800, Scott Bailey wrote:
>> One of the problem with shredding XML is that it is very kludgy to get a 
>> scalar value back from xpath. The xpath function always returns an array 
>> of XML. So for example, to extract a numeric value you need to:
>> 1) use xpath to get the node
>> 2) get the first element of the XML array
>> 3) cast that to varchar
>> 4) cast that to numeric
> 
> There has been talk about adding something like xpath_string,
> xpath_number, xpath_boolean for fetching xpath expressions that don't
> return nodesets.  I think that would fit your use case.

The first two sound very much like what I'm looking for. I'm unsure 
about the third. Is it's purpose to extract the scalar value of an 
expression and cast to bool as the other two do, or is it to identify if 
the xpath expression returned any nodes like xmlexists?

Scott


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

Предыдущее
От: "Kevin Grittner"
Дата:
Сообщение: Re: true serializability and predicate locking
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Re: [COMMITTERS] pgsql: Get rid of the need for manual maintenance of the initial