Re: from postgres to oracle

From: Thomas Good <tomg(at)q8(dot)nrnet(dot)org>
To: Carlos Sousa <carlosdsousa(at)hotmail(dot)com>
Cc: "PostgreSQL::SQL List" <pgsql-sql(at)postgresql(dot)org>
Subject: Re: from postgres to oracle
Date: 2002-10-24 15:20:35
Message-ID: Pine.LNX.4.33.0210241113300.29298-100000@q8.nrnet.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Thu, 24 Oct 2002, Carlos Sousa wrote:

> can some one tell how to transfer the contents from a postgres database into
> a oracle database

Carlos,

I use pg_dump to create full CREATE strings, with no double quotes.

pg_dump -s -n -D -x dbname > dbname.sql

Then I use pg_dump to create full INSERT strings, with no double quotes.

pg_dump -a -n -D -x dbname > dbname.df

Then I edit the dbname.sql file to remove things oracle objects to
like TEXT datatypes (change to whatever you prefer, LONG, VARCHAR2(4000),
etc.) SEQUENCE syntax has to be modified slightly, GRANTS (removed with
the -x flag) should not exist, etc.

I prepend my usual Oracle stuff (SET NLS_DATE_FORMAT = 'whatever you used with
Pg';, SET SCAN OFF; SPOOL load.log;, etc) to the file and then test it.
With sql*plus as the loader you'll want to stick an EXIT; at the EOF if
you run the script using indirection (sqlplus user/pass @dbname.sql)

HTH

I have examples, if you want em.
-----------------------------------------------------------------------
Thomas Good e-mail: tomg(at)sqlclinic(dot)net
Programmer/Analyst phone: (+1) 718.818.5528
Residential Services fax: (+1) 718.818.5056
Behavioral Health Services, SVCMC-NY mobile: (+1) 917.282.7359
-- --
SQL Clinic - An Open Source Clinical Record www.sqlclinic.net
------------------------------------------------------------------------

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message andres javier garcia garcia 2002-10-24 15:49:27 redirect query results to my (stdout) screen
Previous Message Stephan Szabo 2002-10-24 15:19:32 Re: sub-select with aggregate