Re: Postgresql Text field / Visual FoxPro Memo and ODBC - Mailing list pgsql-general

From Paul Tillotson
Subject Re: Postgresql Text field / Visual FoxPro Memo and ODBC
Date
Msg-id 41E5E47C.50005@shentel.net
Whole thread Raw
In response to Re: Postgresql Text field / Visual FoxPro Memo and ODBC  (MargaretGillon@chromalloy.com)
List pgsql-general
>>Ahh, ok.  Misunderstood what your method was.
>>
>>Is there a setting in your ODBC driver for memo as text or something
>>like that?  It's been a while since I played with pgsql from a windows /
>>odbc box, so I am a bit rusty here. It's just a wild guess.
>>
>>
>
>On my Windows box the Postgresql ODBC driver is set with TEXT AS
>LongVarChar, with a maximum length of 8190. FoxPro then turns the
>LongVarChar into a Memo.
>
>Margaret Gillon, IS Dept., Chromalloy Los Angeles, ext. 297
>
>
>
Margaret,

I haven't tried using text, but I came across a very similar problem
when using VARCHAR(n) columns with foxpro:

Since foxpro supports only CHAR (not VARCHAR), then if you have a table
like this:

create table foo (t varchar(6));
insert into foo (t) values ('aaa');

And, in foxpro, you do this to an updateable view of the table:
replace t with 'bbbbbbb'

Then the SQL that foxpro actually generates looks like this:
UPDATE foo SET t = 'bbbbbbb' WHERE t = 'aaa ';

Notice the WHERE clause says t = 'aaa<space><space><space>'; Trailing
whitespace is significant for varchar columns, and so the update hits no
rows.

Now, if foxpro truly thinks that your text columns are of type MEMO then
I believe it would generate the correct SQL; however, if you have your
ODBC driver set to turn text into VARCHAR(n) columns, then I believe
you're being bit by the same bug that I was: foxpro is probably padding
your value with 8000 or so blanks because it thinks your text column is
varchar(8192).

How do you figure this out? Use ethereal.

http://www.ethereal.com/

Paul Tillotson


pgsql-general by date:

Previous
From: Jeff Davis
Date:
Subject: Re: index on user defined type
Next
From: John DeSoi
Date:
Subject: pgEdit 1.0b6