Re: cursors as table sources

From: "Jim C(dot) Nasby" <jnasby(at)pervasive(dot)com>
To: Will Glynn <wglynn(at)freedomhealthcare(dot)org>
Cc: Michael Fuhr <mike(at)fuhr(dot)org>, Peter Filipov <pfilipov(at)netissat(dot)bg>, pgsql-general(at)postgresql(dot)org
Subject: Re: cursors as table sources
Date: 2006-01-11 19:13:20
Message-ID: 20060111191320.GU3902@pervasive.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, Jan 11, 2006 at 01:41:31PM -0500, Will Glynn wrote:
> Michael Fuhr wrote:
>
> >...
> >
> >Is there a reason you'd want to use a cursor instead of, say, a view?
> >
> >Are you just curious or is there a problem you're trying to solve?
> >If I've misunderstood what you're asking then please elaborate.
> >
>
> I have previously thought this to be the most straightforward way to
> solve certain problems, including functions that amount to
> parameter-dependent views. If I want to join them against something not
> anticipated in the first function, I have to either a) write another
> function, copying the code in question, and adding the JOIN I want, or
> b) write another function, call the first function, and execute an
> astronomical number of little queries myself. Both bad options. Why
> can't I SELECT FROM cursor JOIN some_table?

I'm not quite following what you're trying to do here, but there may be
a more practical way if you want to post a concrete example. Or maybe
Tom's reply does what you need...
--
Jim C. Nasby, Sr. Engineering Consultant jnasby(at)pervasive(dot)com
Pervasive Software http://pervasive.com work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Jim Nasby 2006-01-11 19:31:06 Re: [SPAM] - how can we use outer join in Postures - Found word(s) if you received this in error in the Text body
Previous Message Jerome Lyles 2006-01-11 19:11:22 Re: Suse Linux 10.0