Skip site navigation (1) Skip section navigation (2)

Re: Converting from pgsql to sqlserver?

From: mlw <markw(at)mohawksoft(dot)com>
To: armindo(dot)dias(at)dhvmc(dot)pt
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Converting from pgsql to sqlserver?
Date: 2001-09-26 11:50:25
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
armindo(dot)dias(at)dhvmc(dot)pt wrote:
> Greetings.
> I donĀ“t know if this is the right place to ask this, sorry if this don't
> belong here.
> I begun this week working in a new firm. They use linux and PostgreSQL as
> the database for the Intranet site and for the management of CV's and
> Knowledge Management (they have an on-line system to manage and search
> information about workers of the firm and projects they have).
> They now want to convert from the current linux/postgresql platform to
> Windows and SQLServer. I've never worked before with linux or PostgreSQL so
> i know nothing about the capabilities of this combo.

I have no idea under what circumstance one would wish to go from PostgreSQL to
MicrosoftSQL, it just seems like a mistake, but hey, you'll be back when you
realize how much it costs and how much you lose. 

> My question are:
> - the PostgreSQL database has a lot of information. Is it possible to
> migrate the data of the PostgreSQL to SQLServer in Windows? What do i need
> to do?

PostgreSQL has a lot of export utilities. I'm not sure what MSSQL currently
supports. Find a match, and do the export/import.

You may be able to use "pg_dump" to dump out the database as a series of SQL
inserts. It will be slow, but it should be the more portable way to do it. Just
be carfull of date formats. You will probably need a few tries.

> - is it possible to migrate the tables relationships (the relational schema)
> of the DB to SQLServer or do i have to build the DB from scratch?

You will need to dump out the schema for the postgres database by executing
"pg_dump -s database" and that will dump out a SQL script which will create the
schema. no doubt, you will have to edit it to make it work with MSSQL but, it
is a good start.

May I ask why you are going from PostgreSQL to MSSQL?

In response to

pgsql-hackers by date

Next:From: Jan WieckDate: 2001-09-26 12:10:08
Subject: Re: tuple statistics function
Previous:From: Janardhana ReddyDate: 2001-09-26 11:23:27

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group