Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 69989632BCF for ; Mon, 9 Aug 2010 14:40:16 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 17109-10 for ; Mon, 9 Aug 2010 17:40:09 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by mail.postgresql.org (Postfix) with ESMTP id 53944632BC8 for ; Mon, 9 Aug 2010 14:40:08 -0300 (ADT) Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1OiWKS-00061X-Tm for pgsql-odbc@postgresql.org; Mon, 09 Aug 2010 19:40:05 +0200 Received: from wsip-70-167-83-11.mc.at.cox.net ([70.167.83.11]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 09 Aug 2010 19:40:04 +0200 Received: from calvinsmith266 by wsip-70-167-83-11.mc.at.cox.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 09 Aug 2010 19:40:04 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: pgsql-odbc@postgresql.org From: Calvin Subject: Moving data from SQL Server to Postgres via VFP ODBC Driver Date: Mon, 9 Aug 2010 17:13:46 +0000 (UTC) Lines: 19 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: sea.gmane.org User-Agent: Loom/3.14 (http://gmane.org/) X-Loom-IP: 70.167.83.11 (Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.2.8) Gecko/20100722 Firefox/3.6.8 (.NET CLR 3.5.30729)) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.364 tagged_above=-10 required=5 tests=BAYES_05=-0.5, FORGED_HOTMAIL_RCVD2=0.874, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201008/4 X-Sequence-Number: 10381 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!