Re: Function returning any (tuple) type - Mailing list pgsql-general

From Martijn van Oosterhout
Subject Re: Function returning any (tuple) type
Date
Msg-id 20050715212159.GA25864@svana.org
Whole thread Raw
In response to Function returning any (tuple) type  (Ezequiel Tolnay <mail@etolnay.com.ar>)
List pgsql-general
On Fri, Jul 15, 2005 at 04:51:04PM +1000, Ezequiel Tolnay wrote:
> Hi, I wonder if anyone can help me find a solution for this problem. I'm
> porting a database from MS SQL Server 2000 to PostgreSQL 8.0.1 (Windows).

<snip>

> The main problem I see is that the funcitions in PostgreSQL seem to be
> always bound to a particular result datatype. Is there a way to
> circumvent this?

Two solutions I can think of:

- Return SETOF RECORD and specify the type on the actual query from the
client
- Return a cursor reference.

Hope this helps,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.

Attachment

pgsql-general by date:

Previous
From: Scott Marlowe
Date:
Subject: Re: How to create unique constraint on NULL columns
Next
From: Martijn van Oosterhout
Date:
Subject: Re: how to insert '\\' in postgres database using java