Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 7491E6329FF for ; Mon, 9 Aug 2010 14:59:48 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 99896-04 for ; Mon, 9 Aug 2010 17:59:40 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-ww0-f50.google.com (mail-ww0-f50.google.com [74.125.82.50]) by mail.postgresql.org (Postfix) with ESMTP id 134FB632A6C for ; Mon, 9 Aug 2010 14:59:31 -0300 (ADT) Received: by wwb13 with SMTP id 13so225796wwb.19 for ; Mon, 09 Aug 2010 10:59:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type; bh=DmhN/X7ZZwDIJ9zE5guQezAtt6tCFNg2Ofpbg1wPOaA=; b=m6Y4FJ6dB6fGqnecPoUBoGxDxlr8vFwlOoYtvl89qV83A2ESTwtcgYJe+zrZiVqKj0 TXgD82f0XW69+nLdVa6HZZbS9qUghzABIvFNv2yLM5wlWV+FiFHgRZ5okV4R+WcuTGcq pjYJTo5kgm4zairyadKPMAPPuTYyNWgFH67tg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=m1OIzPL0zGMNdfFDSUmV1Opf44PzPeKEJCHwehJZ0py0MVEIHXnodfbFnMoiW6mhsz Ww1kS3fTAPzIorQ6Y0lD0hxJ9AvpCq6BWHWdAZtnf46EqtRiuZm9mukB3l3BKWXO6PIz M1DGmp3wg4z/MYuE9CQe4jU3CKSiP29QErKyc= MIME-Version: 1.0 Received: by 10.216.150.195 with SMTP id z45mr2930953wej.63.1281376770129; Mon, 09 Aug 2010 10:59:30 -0700 (PDT) Received: by 10.216.73.2 with HTTP; Mon, 9 Aug 2010 10:59:30 -0700 (PDT) In-Reply-To: References: Date: Mon, 9 Aug 2010 10:59:30 -0700 Message-ID: Subject: Re: Moving data from SQL Server to Postgres via VFP ODBC Driver From: Richard Broersma To: Calvin Cc: pgsql-odbc@postgresql.org Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-10 required=5 tests=BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001 X-Spam-Level: X-Archive-Number: 201008/5 X-Sequence-Number: 10382 On Mon, Aug 9, 2010 at 10:13 AM, Calvin 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