Re: Cursor Not Found

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Lynn(dot)Tilby(at)asu(dot)edu
Cc: pgsql-general(at)postgresql(dot)org, ltilby(at)asu(dot)edu
Subject: Re: Cursor Not Found
Date: 2004-01-05 05:50:38
Message-ID: 22144.1073281838@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Lynn(dot)Tilby(at)asu(dot)edu writes:
> I have an embedded sql program with a while loop. I declare
> and open a cursor before the while. The fetch forward next
> is inside the while. The first time through the while
> the cursor works perfectly the second time I get the error:

> sql error PerformPortalFetch: portal "foo_crsr" not found

Sounds like you need to hold a transaction open (BEGIN/END block)
around your use of the cursor.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2004-01-05 05:55:18 Re: why the need for is null?
Previous Message Robert Treat 2004-01-05 05:45:43 Re: Is my MySQL Gaining ?