Re: DECLARE CURSOR

From: Frank Miles <fpm(at)u(dot)washington(dot)edu>
To: snpe <snpe(at)snpe(dot)co(dot)yu>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: DECLARE CURSOR
Date: 2002-11-17 05:46:41
Message-ID: Pine.A41.4.44.0211162145080.32236-100000@homer24.u.washington.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

On Sat, 16 Nov 2002, snpe wrote:

> On Saturday 16 November 2002 09:29 pm, Frank Miles wrote:
> > On Fri, 15 Nov 2002, snpe wrote:
> > > Hello,
> > > When I call DECLARE CURSOR out of transaction command success,
> > > but cursor is not created
> > > Reference manual say that this get error :
> > > ERROR: DECLARE CURSOR may only be used in begin/end transaction blocks
> > > I don't find this text in pgsql source code
> > > What is problem ?
> >
> > According to the documentation for DECLARE CURSOR (v.7.2.x):
> >
> > "Cursors are only available in transactions. Use to BEGIN, COMMIT and
> > ROLLBACK to define a transaction block."
> >
> > This seems consistent with your error message. Please try
> > wrapping your DECLARE inside a transaction using BEGIN,...
> >
>
> I understand it.
> I don't understand why 'DECLARE CURSOR' success out of a transaction
> - I expect error

What version are you using? At least with 7.2.x, there is an immediate
error at the DECLARE statement. Perhaps I am misunderstanding your
question?

-frank

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message pginfo 2002-11-17 11:28:13 Re: Welcom & a problem
Previous Message Spirit of Amiga 2002-11-17 00:18:54 ilike comparison involving attributes and wildcards...

Browse pgsql-hackers by date

  From Date Subject
Next Message Al Sutton 2002-11-17 10:13:31 Re: Missing file from CVS?
Previous Message Joe Conway 2002-11-17 04:17:46 Re: Missing file from CVS?