Re: Return resultset from a function

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: Neumann P?ter <neumann(dot)peter(at)calltravel(dot)hu>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Return resultset from a function
Date: 2004-10-12 15:34:00
Message-ID: 20041012153400.GA44574@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Oct 12, 2004 at 04:15:28PM -0700, Neumann P?ter wrote:
>
> I'm fairly new to Postgres and ran into a problem quite soon. Until
> now I used MS Sql2000 and with it I was able to write a simple
> stored procedure that returned a resultset (for example: 'select *
> from table1'). But I don't know the way how to do it in Postgres,
> cause I can't define a function that returns a resultset. I know
> it's a lame question but I need some hints to solve this problem.

I think you're looking for a set-returning function. The following
General Bits article has examples:

http://www.varlena.com/varlena/GeneralBits/26.html

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Jerry LeVan 2004-10-12 15:34:59 Re: Message-ID as unique key?
Previous Message David Siebert 2004-10-12 15:31:36 Re: OS not good for database