Re: turning off autocommit behavior in psql

From: David Van Wie <vanwie(at)cryptio(dot)net>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: turning off autocommit behavior in psql
Date: 2002-08-23 01:36:20
Message-ID: 20020822182421.Q57122-200000@radix.cryptio.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, 22 Aug 2002, Tom Lane wrote:

> I believe our intention has been to modify the backend to offer that
> behavior (with a GUC variable to turn it on or off). Supporting it
> only in psql doesn't seem the way to go.

After playing around with the transaction code for a while, I think I have
a reasonable idea of how to do this in the backend. This is my first time
working with the backend code, so it's entirely possible that I'm going
about this completely wrong, but the change seems to work and pass
regression tests.

I added a GUC variable "autocommit" which defaults to true. (Current
behavior). When it is set to false, the backend should begin a transaction
block if it is not inside one when executing any command. I did this by
changing StartTransactionCommand() in backend/access/transam/xact.c to
call BeginTransactionBlock() after StartTransaction() if it is not
currently in a transaction block.

Does this sound like a reasonable approach?

My first attempt at a patch (to current cvs source) is attached.

...dave

Attachment Content-Type Size
no-autocommit.diff text/plain 3.5 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Lamar Owen 2002-08-23 01:57:59 Re: My head is spinning
Previous Message Marc G. Fournier 2002-08-23 01:27:44 Re: Release of v7.2.2 (Was: Re: @(#)Mordred Labs ad...)