Re: Notes on converting from MySQL 5.0.x to PostgreSQL

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Ron Johnson <ron(dot)l(dot)johnson(at)cox(dot)net>
Cc: pgsql general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Notes on converting from MySQL 5.0.x to PostgreSQL
Date: 2006-06-30 15:50:47
Message-ID: 24462.1151682647@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-www

Ron Johnson <ron(dot)l(dot)johnson(at)cox(dot)net> 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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message howachen 2006-06-30 15:58:27 pgsql vs mysql
Previous Message John Sidney-Woollett 2006-06-30 15:42:54 Re: limit results to one row per foreign object

Browse pgsql-www by date

  From Date Subject
Next Message Ron Johnson 2006-06-30 16:23:53 Re: Notes on converting from MySQL 5.0.x to PostgreSQL
Previous Message paul rivers 2006-06-30 15:40:03 Re: Notes on converting from MySQL 5.0.x to PostgreSQL