Re: Migrate from MySQL to PostgreSQL
| From: | Andreas Korthaus | Date: | Fri, 23 Jan 2004 11:58:10 +0000 |
| Subject: | Re: Migrate from MySQL to PostgreSQL | ||
| References: | 1 2 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-10311@lists.php.net to get a copy of this message | ||
Hi!
Alexey Borzov wrote:
> There is a contrib/mysql dir in PostgreSQL distribution, which
> contains the scripts to convert the schema.
>
> But I'd suggest reviewing and probably refactoring the schema after
> conversion. MySQL's limited feature set, poor support for date and
> time related types, lack of native boolean type sometimes lead to
> really poor design decisions.
Oh, thank you!
I tried my2pg.pl, and it looks good. But what about sequence-tables PEAR::DB
created?
I would like to migrate the data, so the Ids should be megrated too.
my2pg.pl is doing the following:
in MySQL PEAR::DB creates such tables for sequences:
CREATE TABLE mySequence_seq (
id int(10) unsigned NOT NULL,
PRIMARY KEY (id)
) TYPE=MyISAM;
my2pg.pl translates this as followed:
CREATE SEQUENCE mysequence_seq_id_seq;
CREATE TABLE "mySequence_seq" (
"id" INT4 DEFAULT nextval('mysequence_seq_id_seq'),
PRIMARY KEY ("id")
);
Is that correct - or how should I migrate the max-IDs of my sequences?
kind regards,
Andreas