Re: proposal casting from XML[] to int[], numeric[], text[] - Mailing list pgsql-hackers

From Andrew Dunstan
Subject Re: proposal casting from XML[] to int[], numeric[], text[]
Date
Msg-id 473811FD.8080500@dunslane.net
Whole thread Raw
In response to Re: proposal casting from XML[] to int[], numeric[], text[]  ("Nikolay Samokhvalov" <samokhvalov@gmail.com>)
Responses Re: proposal casting from XML[] to int[], numeric[], text[]  ("Pavel Stehule" <pavel.stehule@gmail.com>)
List pgsql-hackers

Nikolay Samokhvalov wrote:
> On Nov 12, 2007 12:59 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>   
>> I'm not clear on what you're proposing.  There is no such thing as an
>> opclass with no operators (or at least, not a useful one), so this seems
>> mutually contradictory.
>>
>>                         regards, tom lane
>>
>>     
>
> You're right, that's my mistake, sorry. So, having casting rules seems
> to be the only option..
>   


We can already cast as text[], and so we can do this:

andrew=# select 
xpath('//foo/text()','<a><foo>1</foo><foo>2</foo></a>')::text[]::int[];xpath
-------{1,2}
(1 row)


So why do we desperately need anything extra at all?

cheers

andrew


pgsql-hackers by date:

Previous
From: adrobj
Date:
Subject: How to keep a table in memory?
Next
From: Simon Riggs
Date:
Subject: Re: [hibernate-team] PostgreSQLDialect