Special char problem, need help. - Mailing list pgsql-hackers

From Boulat Khakimov
Subject Special char problem, need help.
Date
Msg-id 3ACB3B23.E43DC817@inet-interactif.com
Whole thread Raw
List pgsql-hackers
Hi,
   I have a string that is getting encoded using blowfish in postgres 
(using my own function written in C for PG) and  storted in the
database. 
The problem is, that with some strings after encoding is done, I end up 
with a special character in the middle of the encoded string that is  
interprited  as the end of that string, so basically the result is 
trunticated because of that. 
Now the weird part is if I do length(col) where col is the field that 
holds my encoded string,  it returns the real size, but if from C in my 
decode function I do VARSIZE(string) it gives me the wrong (short) size.

My question is, how do I get from C the real size of the string even if
it has special character in it. Length(string) from postgres does it 
somehow, and does it but VARSIZE(string) fails.



Any feedback would be appreciated,
Boulat.


-- 
Nothing Like the Sun


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: All's quiet ... RC3 packaging ...
Next
From: "Mikheev, Vadim"
Date:
Subject: RE: All's quiet ... RC3 packaging ...