This thread was originally posted (incorrectly by me) to the hackers mailing list. Moving the discussion to the gerenal.
Hi Greg,
That is what Pierre pointed out, and you are both right. I am using the text mode.
But it seems pretty crazy that a 140meg bit of data goes to 1.3 gigs. Does that seem a bit excessive?
I avoided the binary mode because that seemed to be rather confusing when having to deal with non-bytea data types. The docs make it sound like binary mode should be avoided because what you get back for a datetime varies per platform.
Thanks,
Michael.
On Tue, Aug 18, 2009 at 12:15 PM, Greg Stark <gsstark@xxxxxxx> wrote:
On Tue, Aug 18, 2009 at 4:04 PM, Michael Clark<codingninja@xxxxxxxxx> wrote:Probably but it's also a pretty technical point and you're programming
> Hello - am I in the wrong mailing list for this sort of problem? :-
in C so it's kind of borderline.
If you're using text-mode then your datum that you're getting from
libpq is a text representation of the datum. For bytea in released
versions that means anything which isn't a printable ascii character
will be octal encoded like \123. You can use PQunescapeBytea to
unescape it.
If you use binary encoding then you don't have to deal with that.
Though I seem to recall there is still a gotcha you have to worry
about if there are nul bytes in your datum. I don't recall exactly
what that meant you had to do though.
--
greg
http://mit.edu/~gsstark/resume.pdf