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

Re: Bug in Function-Transactions?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Josh Berkus" <josh(at)agliodbs(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: Bug in Function-Transactions?
Date: 2002-10-04 18:17:53
Message-ID: 25315.1033755473@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-bugs
"Josh Berkus" <josh(at)agliodbs(dot)com> writes:
> Postgres terminated my back-end connection to the server when it
> reached the VACUUM statement.

> Next, I reconnected. I was quite surprised to discover that Postgres
> had *not* rolled back the changes made by the function before it
> crashed.

Yeah.  The problem here is precisely that VACUUM does internal commits
--- so it committed your function's earlier changes too.  When you
returned from the VACUUM, the function's execution context was gone
as a byproduct of post-commit cleanup.  Oops.  VACUUM is disallowed
inside functions as of 7.3 to prevent this problem.

I don't think you need to be too worried about database corruption
as a result of this experiment, fortunately.

			regards, tom lane

In response to

pgsql-bugs by date

Next:From: Jon WatteDate: 2002-10-04 18:40:16
Subject: Re: Bug #789: Transaction Archival Logging -- Hot Backups
Previous:From: Tom LaneDate: 2002-10-04 18:09:10
Subject: Re: bigint and indexes

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