From: Tim Andersen <timander37@yahoo.com>
To: shyamperi@davlin.co.in
Cc: pgsql-sql@postgresql.org
Subject: Re: Migration from db2 to postgres'
Date: Tue, 19 Aug 2003 05:43:45 -0700 (PDT)
Message-ID: <20030819124345.62081.qmail@web10005.mail.yahoo.com> (raw)
In-Reply-To: <1263873.1061290766755.JavaMail.tomcat@mail.davlin.co.in>
> I wanted to know how can I migrate all my data
> including the schema and their definitions,from
> IBM's db2 to the postgres.
>
I have done this with other DBMSs before by writing a
program (using PowerBuilder). The core concept is
this:
two ODBC datasources (source, target)
for (loop through source's schemas){
for (loop through source's tables){
for(loop through source's rows){
"select [row] from [source table]"
"insert into [target table]"
}
}
}
The key is this: I have a view in both databases to
compare system catalog tables across DBMS platforms.
It is actually the view I was trying to create if you
look back at the SQL questions I asked to this mailing
list a few days ago. the subject was: "Re: [SQL] About
primary keys -- made some progress"
In the past, I ran into several problems with
different datatypes and have had to write workarounds
for those (mainly blobs and timestamps).
Concerning referential integrity: Two options. You
could wait to add all of your foreign keys until after
all of the data has transferred from the source to the
target. The other option is to run the nested loops
several times (this "fills in the gaps" and allows
other tables to be filled each time you run it). I
prefer the second.
I also have a feature to compare the rowcounts of the
source and target so I can be sure all of my data has
been transferred.
I have not yet implemented PostgreSQL into this
application, but I intend to do that over the next few
months.
Tim
__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: timander37@yahoo.com, shyamperi@davlin.co.in
Subject: Re: Migration from db2 to postgres'
In-Reply-To: <20030819124345.62081.qmail@web10005.mail.yahoo.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox