Re: autocommit vs TRUNCATE et al

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: autocommit vs TRUNCATE et al
Date: 2002-10-21 23:11:52
Message-ID: 200210212311.g9LNBqo21724@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:
> Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> > One particularly nasty problem is issuing a VACUUM or TRUNCATE in cases
> > where you don't know the autocommit mode. You could set autocommit to
> > 'on', and issue the command, but how do you know if you need to turn
> > autocommit back off again?
>
> Perhaps RESET AUTOCOMMIT is a good enough answer?

I was unclear on that. RESET sets it back to the postgresql.conf value,
right? Do we know that the session didn't change it earlier in the
script? That's where it gets tricky.

--
Bruce Momjian | http://candle.pha.pa.us
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

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2002-10-21 23:18:23 One 7.3 item left
Previous Message Tom Lane 2002-10-21 23:10:14 Re: autocommit vs TRUNCATE et al