pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Calvin <calvinsmith266@hotmail.com>
To: pgsql-odbc@postgresql.org
Subject: Moving data from SQL Server to Postgres via VFP ODBC Driver
Date: Mon, 9 Aug 2010 17:13:46 +0000 (UTC)
Message-ID: <loom.20100809T190420-758@post.gmane.org> (raw)

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 :

Insert into PostgresTableName Values(m.field1, trim(m.field2....)

The m. systax is because I am using memory variables in VFP. The data contained
in the m.fields has all be trimmed if it is character type. 

Is there any way to keep varying character fields from being padded out to their
maximum length.

Thanks!




view thread (4+ messages)  latest in thread

Message-ID: <loom.20100809T190420-758@post.gmane.org>
Permalink:  ../loom.20100809T190420-758@post.gmane.org/
Also on:    postgresql.org/message-id/loom.20100809T190420-758@post.gmane.org

 · 

reply

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: calvinsmith266@hotmail.com
  Subject: Re: Moving data from SQL Server to Postgres via VFP ODBC Driver
  In-Reply-To: <loom.20100809T190420-758@post.gmane.org>
  References: <loom.20100809T190420-758@post.gmane.org>

* 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