pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
SET AUTOCOMMIT TO OFF
4+ messages / 4 participants
[nested] [flat]

* SET AUTOCOMMIT TO OFF
@ 2004-12-01 14:20 Christoph Haller <ch@rodos.fzk.de>
  2004-12-01 15:42 ` Re: SET AUTOCOMMIT TO OFF Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 4+ messages in thread

From: Christoph Haller @ 2004-12-01 14:20 UTC (permalink / raw)
  To: Richard Huxton <dev@archonet.com>; +Cc: pgsql-sql

Please, could someone point me to the right list 
or tell me how to do a "SET AUTOCOMMIT TO OFF" within libpq. 
The case is pretty urgent, as we have to move our applications 
to Linux and thought it's better to use PG7.4. 
We used to have PG7.3 under HPUX, and we think of a temporary 
downgrade back to 7.3 under Linux, if we cannot solve the 
SET AUTOCOMMIT TO OFF case. 
A simple "No, it's no longer available" or 
"Yes, it goes like ..." by someone from the core developers 
would be greatly appreciated. 

Following what I was asking the other day: 

Since the server-side autocommit off was abolished in 7.4
I am looking for a session-wide replacement, meaning
as long as one connection is running, after every COMMIT
the next SQL-command triggers an implicit BEGIN.

The Release Notes on 7.4 state
The server-side autocommit setting was removed and reimplemented in
client applications and languages. Server-side
autocommit was causing too many problems with languages and applications
that wanted to control their own autocommit
behavior, so autocommit was removed from the server and added to
individual client APIs as appropriate.

So basically, I cannot find the autocommit-off-switch within the libpq
interface.

TIA
Regards, Christoph

BTW
In ./postgresql-7.4.5/doc/html/ecpg-commands.html 
there is still a line saying 
This mode can be explicitly turned off using EXEC SQL SET AUTOCOMMIT TO
OFF.



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: SET AUTOCOMMIT TO OFF
  2004-12-01 14:20 SET AUTOCOMMIT TO OFF Christoph Haller <ch@rodos.fzk.de>
@ 2004-12-01 15:42 ` Tom Lane <tgl@sss.pgh.pa.us>
  2004-12-02 05:11   ` Re: SET AUTOCOMMIT TO OFF sad <sad@bankir.ru>
  0 siblings, 1 reply; 4+ messages in thread

From: Tom Lane @ 2004-12-01 15:42 UTC (permalink / raw)
  To: Christoph Haller <ch@rodos.fzk.de>; +Cc: Richard Huxton <dev@archonet.com>; pgsql-sql

Christoph Haller <ch@rodos.fzk.de> writes:
> Please, could someone point me to the right list 
> or tell me how to do a "SET AUTOCOMMIT TO OFF" within libpq. 

libpq does not have any support for that.

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: SET AUTOCOMMIT TO OFF
  2004-12-01 14:20 SET AUTOCOMMIT TO OFF Christoph Haller <ch@rodos.fzk.de>
  2004-12-01 15:42 ` Re: SET AUTOCOMMIT TO OFF Tom Lane <tgl@sss.pgh.pa.us>
@ 2004-12-02 05:11   ` sad <sad@bankir.ru>
  2004-12-02 08:56     ` Re: SET AUTOCOMMIT TO OFF Richard Huxton <dev@archonet.com>
  0 siblings, 1 reply; 4+ messages in thread

From: sad @ 2004-12-02 05:11 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; Christoph Haller <ch@rodos.fzk.de>; +Cc: Richard Huxton <dev@archonet.com>; pgsql-sql

On Wednesday 01 December 2004 18:42, Tom Lane wrote:
> Christoph Haller <ch@rodos.fzk.de> writes:
> > Please, could someone point me to the right list
> > or tell me how to do a "SET AUTOCOMMIT TO OFF" within libpq.
>
> libpq does not have any support for that.

Does this mean libpq calls always uncommited or commited ?



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: SET AUTOCOMMIT TO OFF
  2004-12-01 14:20 SET AUTOCOMMIT TO OFF Christoph Haller <ch@rodos.fzk.de>
  2004-12-01 15:42 ` Re: SET AUTOCOMMIT TO OFF Tom Lane <tgl@sss.pgh.pa.us>
  2004-12-02 05:11   ` Re: SET AUTOCOMMIT TO OFF sad <sad@bankir.ru>
@ 2004-12-02 08:56     ` Richard Huxton <dev@archonet.com>
  0 siblings, 0 replies; 4+ messages in thread

From: Richard Huxton @ 2004-12-02 08:56 UTC (permalink / raw)
  To: sad <sad@bankir.ru>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; Christoph Haller <ch@rodos.fzk.de>; pgsql-sql

sad wrote:
> On Wednesday 01 December 2004 18:42, Tom Lane wrote:
> 
>>Christoph Haller <ch@rodos.fzk.de> writes:
>>
>>>Please, could someone point me to the right list
>>>or tell me how to do a "SET AUTOCOMMIT TO OFF" within libpq.
>>
>>libpq does not have any support for that.
> 
> 
> Does this mean libpq calls always uncommited or commited ?

1. Connect
2. Issue "INSERT ..."
The insert will be committed.

1. Connect
2. Issue "INSERT...; UPDATE...; INSERT...;" in one PQexec
All 3 will be committed in one transaction

1. Connect
2. Issue "BEGIN"
3. Issue "INSERT..."
4. Issue "UPDATE..."
5. Issue "INSERT..."
6. etc
Until you issue COMMIT/ROLLBACK the transaction remains open.
If you had an error at step 3, then 4,5 would fail because the 
transaction would be aborted (but waiting for you to issue ROLLBACK).

I think that covers all the combinations.
--
   Richard Huxton
   Archonet Ltd



^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2004-12-02 08:56 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2004-12-01 14:20 SET AUTOCOMMIT TO OFF Christoph Haller <ch@rodos.fzk.de>
2004-12-01 15:42 ` Tom Lane <tgl@sss.pgh.pa.us>
2004-12-02 05:11   ` sad <sad@bankir.ru>
2004-12-02 08:56     ` Richard Huxton <dev@archonet.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox