Re: Procedures - Mailing list pgsql-general

From Nilesh Govindarajan
Subject Re: Procedures
Date
Msg-id 4B7FE37C.7020709@itech7.com
Whole thread Raw
In response to Re: Procedures  (Raymond O'Donnell <rod@iol.ie>)
Responses Re: Procedures
Re: Procedures
List pgsql-general
On 02/20/2010 06:54 PM, Raymond O'Donnell wrote:
> On 20/02/2010 13:08, Nilesh Govindarajan wrote:
>> On 02/20/2010 02:32 PM, John R Pierce wrote:
>>> Nilesh Govindarajan wrote:
>>>> How do I create a procedure using plpgsql cursors to print the output
>>>> of the query in the cursor (using for loop) ?
>>>>
>>>> In all docs I found, it seems to be a must to return data to the call
>>>> which is not what I want.
>>>>
>>>
>>> what is it going to print it on? the postgres server processes have no
>>> console or stdout device.
>>
>> Okay, so how do I print it to stdout ?
>
> Well, it still has to get back to the client from the server - hence you
> need to return the data.... stout here will be stdout of the server, not
> the client.
>
> Maybe if you say more clearly what it is you *do* want, rather than what
> you don't, people may be able to help you. :-)
>
> Ray.
>

Okay here's my query -

select c.cid, c.subject, n.title from comments c, node n where c.nid =
n.nid and c.status != 0;

This is the query to check list of comments requiring admin approval and
also the article titles on which this is posted.

I want to see this result on the screen at psql prompt. Since it may
return multiple rows, a cursor has to be employed here.

Now if I employ a cursor here in the function/procedure, how to see the
results ?

--
Nilesh Govindarajan
Site & Server Adminstrator
www.itech7.com

pgsql-general by date:

Previous
From: Raymond O'Donnell
Date:
Subject: Re: Procedures
Next
From: Raymond O'Donnell
Date:
Subject: Re: Procedures