RE: MS SQL 7.0 to PostgreSQL 7.1

From: Jeff Eckermann <jeckermann(at)verio(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: RE: MS SQL 7.0 to PostgreSQL 7.1
Date: 2001-05-09 20:48:32
Message-ID: 08CD1781F85AD4118E0800A0C9B8580B094A74@NEZU
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Also:
* Watch out for embedded tabs and carriage returns in your data: these
will cause problems during or after your COPY into PostgreSQL.
* Check the value used in the exported file to represent NULL values
(could be an empty string, or "NULL", or something else), and use that in
your COPY statement: "COPY table from stdin with null as 'whatever';"

> -----Original Message-----
> From: Brent R. Matzelle [SMTP:bmatzelle(at)yahoo(dot)com]
> Sent: Wednesday, May 09, 2001 2:40 PM
> To: pgsql-general(at)postgresql(dot)org
> Subject: Re: [GENERAL] MS SQL 7.0 to PostgreSQL 7.1
>
> --- "Ryan C. Bonham" <Ryan(at)srfarms(dot)com> wrote:
> > My question is what is the best way to import my data from MS
> > SQL. I
> > installed the ODBC Drivers and tried exporting using the MS
> > import/export
> > tool.. It successfully creates the tables, but fails to import
> > any data,
> > with a error stating that the relationship doesn't exist. So
> > there goes the
> > easy route and MS POS tool.. What's the correct way of doing
> > this?? Thanks
> > in advance
>
> First, verify that all of the data types of the old SQL Server
> tables were correctly converted to Postgres. Then to transfer
> the rest of the data over use the MS bulk copy (bcp) tool or the
> export tool (MSSQL 7 or higher I believe) to create
> tab-delimited dump files for each table. Then you must add
> this to the beginning of each dump file: { COPY "table_name"
> FROM stdin; } And add a { \. } at the end of the dump file.
> Then you can use { psql -f table_name.dump } to import the data
> from the dump files.
>
> Brent
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Auctions - buy the things you want at great prices
> http://auctions.yahoo.com/
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
> message can get through to the mailing list cleanly

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Bruce Momjian 2001-05-09 21:02:16 Re: Oracle to Pg tool
Previous Message Gilles DAROLD 2001-05-09 20:40:41 Re: Oracle to Pg tool