X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 922D953647 for ; Thu, 31 Mar 2005 18:34:22 +0100 (BST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 04648-05 for ; Thu, 31 Mar 2005 17:34:20 +0000 (GMT) Received: from mail.logix-tt.com (wallaby.dingens.org [212.75.36.180]) by svr1.postgresql.org (Postfix) with ESMTP id 8D30753828 for ; Thu, 31 Mar 2005 18:34:19 +0100 (BST) Received: from kingfisher.intern.logi-track.com (J07bb.j.pppool.de [85.74.7.187]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.logix-tt.com (Postfix) with ESMTP id 6EDA3A8650; Thu, 31 Mar 2005 19:34:19 +0200 (CEST) Received: from [127.0.0.1] (localhost [127.0.0.1]) by kingfisher.intern.logi-track.com (Postfix) with ESMTP id 9E7EFAB291; Thu, 31 Mar 2005 19:34:15 +0200 (CEST) Message-ID: <424C3496.4010506@logix-tt.com> Date: Thu, 31 Mar 2005 19:34:14 +0200 From: Markus Schaber User-Agent: Mozilla Thunderbird 1.0 (X11/20050116) X-Accept-Language: de-DE, de, en-us, en MIME-Version: 1.0 To: Kris Jurka Cc: Giuseppe Sacco , "pgsql-jdbc@postgresql.org" Subject: Re: DDL in transactions? References: <1112254334.3881.8.camel@localhost> In-Reply-To: X-Enigmail-Version: 0.90.1.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.069 tagged_above=0 required=5 tests=AWL, FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200503/215 X-Sequence-Number: 12607 Hi, Giuseppe, Kris Jurka schrieb: >>My question is: why? Shouldn't DDL be executed immediately? > > No. DDL in postgresql is fully transactable and may be rolled back or > committed. That doesn't explain why the above code doesn't work. > Because the two executeUpdates are on the same Statement on the same > Connection the second execution should see the newly created table because > it is in the same transaction. Perhaps you are not showing us the real > code you are using and you actually have two connections? You can simply try this out via psql: lwgeom=# begin; BEGIN lwgeom=# create table tester (a int); CREATE TABLE lwgeom=# insert into tester values (1); INSERT 281855490 1 lwgeom=# rollback; ROLLBACK lwgeom=# select * from tester; ERROR: relation "tester" does not exist lwgeom=# HTH, Markus