Re: TCL with large objects on Win

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andreas Kretzer <andi(at)kretzer-berlin(dot)de>
Cc: Postgres Interface List <pgsql-interfaces(at)postgresql(dot)org>
Subject: Re: TCL with large objects on Win
Date: 2001-12-03 14:57:07
Message-ID: 12963.1007391427@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

Andreas Kretzer <andi(at)kretzer-berlin(dot)de> writes:
> When using the pg_lo_import or pg_lo_export functions,
> everything is ok under Linux (where I develop and test
> the application). When I started to make a test under
> MS I recognized, that all this stuff is broken! It won't
> import nor export binary data (while a fist test with some
> pure text and RTF files worked ok). So this all is related
> to the binary stuff (CR/LF and EOF chars I think).

Ugh. I'm not sure that that stuff was ever tested with Windows clients
before, and even less sure that it was tested with any recent Tcl
version. It's very likely that you've exposed a bug.

It's possible that the problem is related to UTF8 translation that's
been imposed by recent Tcl versions. libpgtcl's original coding
predates Tcl's adoption of UTF8, and I'm not sure that anyone has done
a careful review to look for translation issues. So keep that in mind
while you're looking ...

> if returns the amount of read bytes (lets say we are at the
> beginning of a large file, so it really reads the 4k bytes).
> When I test the length of the string, it will be a lot
> shorter (varies, most time it is about half the size I expected
> it to be).

This definitely smells like a translation issue: is the length counted
in bytes, or characters? Does your data contain sequences that might
be misinterpreted as UTF8 multibyte characters?

> I found an implemention fault in
> src/interfaces/libpgtcl/pgtclCmds.c
> The second letter of the mode in Pg_lo_open() ANDs its binary
> value to the one in the case-statement for the first letter.
> This should obviously be an ORing function like
> mode |= INV_READ;
> or
> mode |= INV_WRITE;

Ooops. Fixed in CVS --- thanks for the report!

> Hope that someone can help me. I can't compile the windows
> DLLs (got no Microsoft compiler and don't want to use the
> cygnus stuff). Is there a chance to compile the DLLs with
> GNU C?

No idea. Try the folks on pgsql-cygwin...

regards, tom lane

In response to

Responses

Browse pgsql-interfaces by date

  From Date Subject
Next Message Bruce Momjian 2001-12-03 16:21:43 Re: libpqxx update
Previous Message Andreas Kretzer 2001-12-03 10:10:26 TCL with large objects on Win