From: Richard Broersma <richard.broersma@gmail.com>
To: Calvin <calvinsmith266@hotmail.com>
Cc: pgsql-odbc@postgresql.org
Subject: Re: Moving data from SQL Server to Postgres via VFP ODBC Driver
Date: Mon, 9 Aug 2010 10:59:30 -0700
Message-ID: <AANLkTik8QBPwGOTbRpdXm+3+6O2wJ1LE5P3WnmPwcyyB@mail.gmail.com> (raw)
In-Reply-To: <loom.20100809T190420-758@post.gmane.org>
References: <loom.20100809T190420-758@post.gmane.org>
On Mon, Aug 9, 2010 at 10:13 AM, Calvin <calvinsmith266@hotmail.com> wrote:
> I am attempting to move data from a SQL Server 2008 database to Postgres v8.4. I
> am using Visual Fox Pro as an intermediate step in this process. I open a
> connection to the SQL tables using the ODBC driver and at the same time open a
> connect to the PostGres table using PostgresSQL30. The reason I am doing it this
> way is I cannot seem to overcome issues concerning bit fields in SQL Server and
> Booleans in Postgres. Using VFP I can do a quick and dirty conversion. However,
> the problem is that when I look at the data in Postgres it converted
> successfully with the exception of varying character fields which have been
> padded to their maximum length. My insert statement is in the form :
It would seem that the string padding is taking place on the
SQL-Server side. Is there anyway to verify if it is treating the
varchar type as char in its odbc driver?
If you need to you can put the trimming operation in before insert
trigger functions on these columns. But I expect this solution is not
optimal.
--
Regards,
Richard Broersma Jr.
Visit the Los Angeles PostgreSQL Users Group (LAPUG)
http://pugs.postgresql.org/lapug
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-odbc@postgresql.org
Cc: richard.broersma@gmail.com, calvinsmith266@hotmail.com
Subject: Re: Moving data from SQL Server to Postgres via VFP ODBC Driver
In-Reply-To: <AANLkTik8QBPwGOTbRpdXm+3+6O2wJ1LE5P3WnmPwcyyB@mail.gmail.com>
References: <loom.20100809T190420-758@post.gmane.org> <AANLkTik8QBPwGOTbRpdXm+3+6O2wJ1LE5P3WnmPwcyyB@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox