Re: Cursor Error - Mailing list pgsql-general

From Craig Ringer
Subject Re: Cursor Error
Date
Msg-id 4892C8F2.2020007@postnewspapers.com.au
Whole thread Raw
In response to Re: Cursor Error  ("Bob Pawley" <rjpawley@shaw.ca>)
List pgsql-general
Bob Pawley wrote:
> Is it allowed to declare a cursor in this manner??
>
> Declare
> procgraphic cursor for select p_id.p_id.process_id
> from p_id.p_id, processes_count
> where p_id.p_id.p_id_id = processes_count.p_id_id;

Using DECLARE instead of OPEN? Yes, but that won't somehow make a cursor
involving a join updatable. See:

http://www.postgresql.org/docs/8.3/interactive/plpgsql-cursors.html

DECLARE and OPEN do not have exactly the same meaning, as explained by
the above documentation. To use a cursor defined with DECLARE you must
use OPEN - see section 38.7.2.3 ("Opening a Bound Cursor") of the
documentation.

--
Craig Ringer

pgsql-general by date:

Previous
From: Craig Ringer
Date:
Subject: Re: Copy fails
Next
From: Marc Cuypers
Date:
Subject: Postgresql not using an index