Re: How access to array component

From: "Cristian Cappo A(dot)" <ccappo(at)cnc(dot)una(dot)py>
To: Joe Conway <mail(at)joeconway(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: How access to array component
Date: 2003-07-21 19:17:27
Message-ID: 3F1C0407.32205.173766B@localhost
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Joe
Tried, but...

>> select (foo(10::int2,20::int2))[1];
>> ERROR: parser: parse error at or near "[" at character 32

I'm using the version 7.3.3

Thanks..
---

> 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
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
> (send "unregister YourEmailAddressHere" to majordomo(at)postgresql(dot)org)

------------------------------------
Cristian Cappo Araujo
Desarrollo de Proyectos - Direccion Tecnica
Centro Nacional de Computación
Universidad Nacional de Asunción

email: ccappo(at)cnc(dot)una(dot)py
tel. : 595-021-585550
fax : 595-021-585619

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Bruce Momjian 2003-07-22 00:32:35 Re: OR vs UNION
Previous Message Barry Lind 2003-07-21 18:55:59 Re: Timestamp problem