>>Then, even if you do write something to use postgresql a lot of hosts
>>don't support it anyway ('mysql is good enough').. so you're stuck.
>
> Well, I guess the moment all the hoster's have to buy commercial licenses for
> providing a database they'll switch to PG in no time - or charge more for the
> people who absolutely need mysql.
> Maybe it's time to write a sophisticated "mysql to postgresql" automation
> tool....
Converting the database itself is easy (there's a few scripts in contrib
and I've written one myself).
The hard stuff is converting stuff like mysql's "last_insert_id" to a
postgres alternative, fixing queries that aren't standard..
eg mysql doesn't force you to group by all columns being selected - I
can do:
select field1, field2, field3 from table group by field1;
and have it valid in mysql (but of course postgres will tell you it's
not valid and need to add grouping for field2 and field3).
mysql 5 is the first version where you can enforce "not null"
constraints, before that you could do:
create table a(a int, b int not null);
insert into a(a) values('1');
and it would accept it (even though 'b' doesn't have a default value),
so some code could be rather "dodgy" for lack of a better term.
The list goes on about differences (date handling, full text indexing
for example).