Search Postgresql Archives

Re: Read MS-SQL data into Postgres via ODBC link?

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

 



>From: pgsql-general-owner@xxxxxxxxxxxxxx [mailto:pgsql-general-owner@xxxxxxxxxxxxxx] On Behalf Of Jonathan Brinkman
>Sent: Tuesday, July 05, 2011 7:48 AM
>To: pgsql-general@xxxxxxxxxxxxxx
>Cc: 'Brent Wood'
>Subject: Re: Read MS-SQL data into Postgres via ODBC link?

> 

>Thanks

>I’m importing into Postgresql 8.4.8 from MSSQL 2005.

> 

>I do not have control over the MSSQL server, it is at a customer’s site. I only have access to read-only views on their server, from which I replicate the data to my postgres staging tables.

> 

>I cannot have the MSSQL server do anything like create .csv files, since it’s not my server and the customer will not do that kind of thing (or create DTS scripts, etc. from the PUSH side).

> 

>I’m hoping there is a way I can simply SELECT from an ODBC source and use that SELECT as part of a Postgres INSERT statement.

 

>I don’t use MySQL for anything.

 

>Thanks much for your response!

> 

>J

 

Just connect to both databases (in Perl or Python, or something), do a select on the MSSQL data on the MSSQL handle.  When you get the row into a set of column variables, just insert the columns via the Postgres handle into the Postgres database.  Simple as pie.  You can prepare the INSERT statement so that multiple executions use bind variables.  Commit every 1000 rows or whatever.

 

Susan

 


[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