MySQL Forums
Forum List  »  PostgreSQL

postgres table linking problem
Posted by: Joe Toth
Date: August 08, 2007 06:37PM

I'm a newbie with database theory so maybe I'm missing something here.

I am trying to migrate a subset of the tables from a postgres database to
mysql. I used the postgres dumpfile and the lightbox tool to create
the equivalent tables in mysql. The postgres dump file adds the foreign key columns separately from the create column description.

For example postgres table "file" contains:

CREATE TABLE file (
coreobjectid integer NOT NULL,
fullpath character varying(255),
filename character varying(255),
url character varying(255)
);

...

...

ALTER TABLE ONLY file
ADD CONSTRAINT file_pkey PRIMARY KEY (coreobjectid);


ALTER TABLE ONLY file
ADD CONSTRAINT "$1" FOREIGN KEY (coreobjectid) REFERENCES coreobject(id) ON UPDATE NO ACTION ON DELETE NO ACTION DEFERRABLE INITIALLY DEFERRED;



Some entries from the postgres table "file"

17030 -1 \N \N \N
36829 739 \N Biochemistry_v38_p13592-13601.pdf \N
81743 2653 \N Bioinformatics_v17_p763-774.pdf \N
36908 746 \N Manipulation of standard deviations_1.doc \N

How do I import the foreign key relationships into mysql?



Edited 2 time(s). Last edit at 08/08/2007 09:05PM by Joe Toth.

Options: ReplyQuote


Subject
Views
Written By
Posted
postgres table linking problem
8075
August 08, 2007 06:37PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.