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:25:25 |
Message-ID: | 200210212325.g9LNPP023448@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:
> > Tom Lane wrote:
> >> 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.
>
> You're postulating a scenario in which some snippet of code doesn't know
> what the surrounding script/application likes for AUTOCOMMIT, but does
> know enough about the context to know that it's not inside a transaction
> block already. That combination seems moderately implausible to me.
> Anyone have an example where it'd really be useful?
Well, in most cases, if you don't know, you do BEGIN ... COMMIT, but in
the case of VACUUM/TRUNCATE, you can't do that, so you need some smarts.
It is a contrived example. I am just throwing it out for illumination.
I often throw out scenarios at the edges to see if it strikes anyone as
a problem. When it doesn't, we can move ahead.
--
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
From | Date | Subject | |
---|---|---|---|
Next Message | Josh Berkus | 2002-10-22 00:04:36 | Flyer, Press Release |
Previous Message | Tom Lane | 2002-10-21 23:21:40 | Re: autocommit vs TRUNCATE et al |