Accessing an array element from a function

From: Mike Nolan <nolan(at)gw(dot)tssi(dot)com>
To: pgsql-general(at)postgresql(dot)org (pgsql general list)
Subject: Accessing an array element from a function
Date: 2004-09-30 22:23:46
Message-ID: 200409302223.i8UMNl4G030461@gw.tssi.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

This may be mostly a documention issue:

I have a function with two parameters that returns an array: text[].

I want to access just the first element of that array within
my SQL statement.

This doesn't work:

select myfunc(1,2)[1];

This does work:
select (myfunc(1,2)[1];

If that's how it's supposed to work, is that documented somewhere?
--
Mike Nolan

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Scott Frankel 2004-09-30 22:31:18 readline install questions
Previous Message Tom Lane 2004-09-30 21:48:10 Re: about "pg_dump " without pompt password