Re: How access to array component

From: Joe Conway <mail(at)joeconway(dot)com>
To: Cristian Cappo <ccappo(at)cnc(dot)una(dot)py>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: How access to array component
Date: 2003-07-20 03:04:20
Message-ID: 3F1A06B4.6090301@joeconway.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Cristian Cappo wrote:
> >>> select __function(10::int2, 20::int2)[1]
> ^^^ parsing error.
>

Try:

create or replace function foo(int2, int2 ) returns _varchar as '
select ''{1,2}''::_varchar
' language 'sql';

regression=# select (foo(10::int2, 20::int2))[1];
foo
-----
1
(1 row)

HTH,

Joe

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2003-07-20 04:40:22 Re: min() and NaN
Previous Message Greg Stark 2003-07-19 23:11:30 Re: casting to arrays