Re: proposal casting from XML[] to int[], numeric[], text[]

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Nikolay Samokhvalov <samokhvalov(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: proposal casting from XML[] to int[], numeric[], text[]
Date: 2007-11-12 08:42:37
Message-ID: 473811FD.8080500@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Nikolay Samokhvalov wrote:
> On Nov 12, 2007 12:59 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2007-11-12 08:48:41 Re: [hibernate-team] PostgreSQLDialect
Previous Message adrobj 2007-11-12 06:49:56 How to keep a table in memory?