X-Original-To: pgsql-general-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 744DF9FA163 for ; Fri, 30 Jun 2006 12:51:11 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 70449-02 for ; Fri, 30 Jun 2006 12:50:56 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 1B1BB9FA605 for ; Fri, 30 Jun 2006 12:50:54 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.6/8.13.6) with ESMTP id k5UFolw1024463; Fri, 30 Jun 2006 11:50:47 -0400 (EDT) To: Ron Johnson cc: pgsql general Subject: Re: Notes on converting from MySQL 5.0.x to PostgreSQL In-reply-to: <44A5418F.8040901@cox.net> References: <1151680333.13129.55.camel@state.g2switchworks.com> <44A5418F.8040901@cox.net> Comments: In-reply-to Ron Johnson message dated "Fri, 30 Jun 2006 10:21:51 -0500" Date: Fri, 30 Jun 2006 11:50:47 -0400 Message-ID: <24462.1151682647@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200606/1226 X-Sequence-Number: 97598 Ron Johnson writes: > Scott Marlowe wrote: >> However, the more interesting thing here, is that every >> statement, including DDL is transactable, except for a couple of >> big odd ones, like create database. So, in postgresql, you can do: > But isn't that what it means to be "transactional"? Or am I spoiled > by my "big, expensive enterprise database"? Being able to roll back DDL (table-schema modifications) isn't that common. Since PG keeps most of its schema information in tables, we have it easier than some other systems supporting DDL rollback, but it's still tricky. As an example, a long time ago we used to name table files after the table and database directories after the database, which made it easy to see what was what under $PGDATA, but prevented a lot of DDL from being transactional. For instance BEGIN; DROP TABLE foo; CREATE TABLE foo (some-new-definition); ROLLBACK; couldn't work because there would need to be two physical files named foo in the interim until you commit or roll back. ALTER TABLE RENAME had some related problems. Now we name all the filesystem objects using OIDs that can be chosen to never collide, even if they belong to database objects with similar names. Last I checked, mysql was still using table names for file names, so they're on the wrong side of this. regards, tom lane