Skip site navigation (1) Skip section navigation (2)

AUTO COMMIT

From: Atif Jung <atifjung(at)gmail(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: AUTO COMMIT
Date: 2010-06-28 14:56:51
Message-ID: AANLkTimy-_cwNMYVZas3vUUh9Yp3iaG_Zu17FbGPoz4-@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-novice
The postgres manual states:

"In the default mode, statements are committed only when EXEC SQL COMMIT is
issued. The embedded SQL interface also supports autocommit of transactions
(similar to libpq behavior) via the -t command-line option to ecpg (see
below) or via the EXEC SQL SET AUTOCOMMIT TO ON statement. In autocommit
mode, each command is automatically committed unless it is inside an
explicit transaction block. This mode can be explicitly turned off using EXEC
SQL SET AUTOCOMMIT TO OFF."

I've used the -t command-line option when compiling my code, and AUTOCOMMIT
is set, but I still get the following error message when declaring a cursor:

DECLARE CURSOR can only be used in transaction blocks.

What am I doing wrong?

Thanks

Atif

Responses

pgsql-novice by date

Next:From: Atif JungDate: 2010-06-28 15:45:32
Subject: Re: DECLARE CURSOR
Previous:From: Tom LaneDate: 2010-06-28 14:00:17
Subject: Re: DECLARE CURSOR

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group