Received: from localhost (maia-3.hub.org [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 442AC9FB2E9 for ; Sun, 15 Jul 2007 14:37:14 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 17690-04 for ; Sun, 15 Jul 2007 14:37:01 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from www.goldencode.com (www.goldencode.com [72.17.138.114]) by postgresql.org (Postfix) with ESMTP id 6D9DD9FB2C8 for ; Sun, 15 Jul 2007 14:37:11 -0300 (ADT) Received: from emlsrv01.internal.goldencode.com (unknown [192.168.1.51]) by www.goldencode.com (Postfix) with SMTP id EA6A81C150 for ; Sun, 15 Jul 2007 12:39:16 -0400 (EDT) Received: from [192.168.1.103] (ecf.internal.goldencode.com [192.168.1.103]) by emlsrv01.internal.goldencode.com (Hethmon Brothers Smtpd) id 20070715132935-5632-7 ; Sun, 15 Jul 2007 13:29:35 -0500 Message-ID: <469A5AA6.3090005@goldencode.com> Date: Sun, 15 Jul 2007 13:34:30 -0400 From: Eric Faulhaber Reply-To: ecf@goldencode.com Organization: Golden Code Development User-Agent: Thunderbird 1.5.0.12 (X11/20070604) MIME-Version: 1.0 To: Oliver Jowett CC: pgsql-jdbc@postgresql.org Subject: Re: Implicit autocommit? References: <4699BA51.6050001@goldencode.com> <4699FFF6.4050506@opencloud.com> In-Reply-To: <4699FFF6.4050506@opencloud.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.001 tagged_above=0 required=5 tests=BAYES_50=0.001 X-Spam-Level: X-Archive-Number: 200707/59 X-Sequence-Number: 17233 Oliver Jowett wrote: > Eric Faulhaber wrote: > >> I debugged into the driver and found it was issuing a "BEGIN" to the >> backend just before each statement. Why would it do this with >> autocommit disabled? > > autocommit on = implicit transaction wrapping each individual > statement. In the postgres world, this means "don't use BEGIN/COMMIT > at all". > > autocommit off = explicit transaction demarcation, the first statement > executed starts a new transaction that lasts until rollback()/commit() > are called. In the postgres world, this means "use > BEGIN/ROLLBACK/COMMIT to demarcate the transaction". So the driver > issues a BEGIN to start a new transaction as necessary. > > -O Unless I misunderstand your answer, this suggests that vacuum cannot be run via JDBC, since it cannot be run within a transaction block. It is my understanding that autovacuum skips temp tables: http://archives.postgresql.org/pgsql-general/2007-06/msg01645.php This is consistent with my experience. So, how can I vacuum a long-lived temp table created with a JDBC connection? Thanks, Eric Faulhaber