Re: Function returning an array

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Josh Berkus" <josh(at)agliodbs(dot)com>
Cc: Francesco Casadei <f_casadei(at)libero(dot)it>, pgsql-sql(at)postgresql(dot)org
Subject: Re: Function returning an array
Date: 2001-08-23 17:07:17
Message-ID: 5905.998586437@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

"Josh Berkus" <josh(at)agliodbs(dot)com> writes:
>> What's the correct syntax to return two VARCHAR(255)?

> There isn't one. At this time, functions cannot return arrays.

Well, they *can*, it's just that there's no syntax to support
constructing an array value in SQL or plpgsql languages.

I know that you can do it in pltcl (there are examples in the pltcl
self-test), and of course you can do it in C. A brute-force solution
is to make a support function in one of those languages that takes two
varchars and returns an array of varchar.

regards, tom lane

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Jason Charette 2001-08-23 18:05:49 HELP: Trend reporting
Previous Message Josh Berkus 2001-08-23 15:44:37 Re: Function returning an array