Search Postgresql Archives

Re: sybase->postgresql

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



You can also use sybase's BCP for some tables, if you know that there's
nothing that needs to be quoted. When I migrated stats.distributed.net
from sybase to pgsql I used both tactics; I bcp'd every table I could,
then used a perl script to copy from sybase to pgsql for tables that had
embedded tabs, linefeeds, etc.

The code I used for our migration is at
http://cvs.distributed.net/viewcvs.cgi/stats-sql/postgresql/. move.pl is
the perl script I used. Since I used BCP for all the really big tables I
just had the perl script insert directly into pgsql, but you could
always have it produce a file that copy could deal with as Josh
mentioned (in fact, you wouldn't even need to write to a file; copy can
read from stdin. This would save time if the amount of downtime for the
migration matters to you.)

On Wed, Feb 11, 2004 at 09:04:14AM -0800, Josh Berkus wrote:
> Ashish,
> 
> > postgresql you said (I saw this on a list):
> > > Also, if you have a *running* Sybase database, conversion is a lot
> > > easier ... you can use Perl::DBI to read directly from sybase to a COPY
> > > file, and then load the COPY file into Postgres.
> >
> > I am brand new to postgres and do have a running sybase which I wish to
> > convert. I have used perl's DBlib. However, I am not sure how to get the
> > output to copy. I will also be sending the question to postgres lists, but
> > thought I would send it to you too in case you are able to suggest
> > something.
> 
> Easiest way?   Use perl to pull from Sybase and build a COPY-formatted file.  
> Then have perl log into postgres and load the file.   Seems awkward, but it's 
> actually *much* faster than other methods.   We do this for a 1GB Sybase 
> database for one client on a nightly basis; takes about 40 minutes.
> 
> -- 
> Josh Berkus
> Aglio Database Solutions
> San Francisco
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
> 
>                http://archives.postgresql.org
> 

-- 
Jim C. Nasby, Database Consultant                  jim@nasby.net
Member: Triangle Fraternity, Sports Car Club of America
Give your computer some brain candy! www.distributed.net Team #1828

Windows: "Where do you want to go today?"
Linux: "Where do you want to go tomorrow?"
FreeBSD: "Are you guys coming, or what?"

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux