Re: How access to array component - Mailing list pgsql-sql

From Joe Conway
Subject Re: How access to array component
Date
Msg-id 3F1A06B4.6090301@joeconway.com
Whole thread Raw
In response to How access to array component  (Cristian Cappo <ccappo@cnc.una.py>)
Responses Re: How access to array component  ("Cristian Cappo A." <ccappo@cnc.una.py>)
List 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



pgsql-sql by date:

Previous
From: Terence Kearns
Date:
Subject: Re: (trigger function) -> ERROR: NEW used in non-rule query
Next
From: Chris Travers
Date:
Subject: SECURITY DEFINER changes CURRENT_USER?