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

Re: SET autocommit begins transaction?

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Sean Chittenden <sean(at)chittenden(dot)org>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: SET autocommit begins transaction?
Date: 2002-09-18 22:05:58
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-bugs
Sean Chittenden wrote:
> db.transaction do |dbh|
>'DELETE FROM tbl WHERE id = 5')
>   db['AutoCommit'] = true
> end
> Because there wasn't a commit given, that shouldn't actually delete
> the rows found, but by tossing that AutoCommit in there, it should and
> will generate a nifty warning if AutoCommit sends the above

You can't be setting autocommit willy-nilly.  What I was going to
suggest is that we allow 'SET autocommit' only at the start of a
transaction, and then have it take effect immediately.  If you try
autocommit when a transaction is already in progress from a previous
statement, we throw an error.

  Bruce Momjian                        |
  pgman(at)candle(dot)pha(dot)pa(dot)us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

In response to


pgsql-bugs by date

Next:From: Tom LaneDate: 2002-09-18 22:08:02
Subject: Re: SET autocommit begins transaction?
Previous:From: Sean ChittendenDate: 2002-09-18 22:02:22
Subject: Re: SET autocommit begins transaction?

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