pg.ddx.io pgsql-interfaces@postgresql.org mailing list archive
help / color / mirror / Atom feedlarge object I/O seeing \\xxx encoding with v3 protocol
4+ messages / 2 participants
[nested] [flat]
* large object I/O seeing \\xxx encoding with v3 protocol
@ 2004-08-13 12:38 Eric Marsden <emarsden@laas.fr>
0 siblings, 1 reply; 4+ messages in thread
From: Eric Marsden @ 2004-08-13 12:38 UTC (permalink / raw)
To: pgsql-interfaces
Hi,
When using the v3 fe/be protocol, data read and written to large
objects via the loread and lowrite functions seems to be \\xxx
encoded, as per literal escaping or data for the BYTEA type. For
instance, newlines written using lowrite() are later received as
\\012.
[I am seeing this with my own implementation of the fe/be protocol;
I'm not using libpq.]
I find this behaviour to be unfortunate, because it differs from the
v2 protocol behaviour, and because I don't see any reason to encode
the binary data in large objects. Was this change intentional?
Thanks,
--
Eric Marsden <URL:http://www.laas.fr/~emarsden/;
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: large object I/O seeing \\xxx encoding with v3 protocol
@ 2004-08-13 14:10 Tom Lane <tgl@sss.pgh.pa.us>
parent: Eric Marsden <emarsden@laas.fr>
0 siblings, 1 reply; 4+ messages in thread
From: Tom Lane @ 2004-08-13 14:10 UTC (permalink / raw)
To: Eric Marsden <emarsden@laas.fr>; +Cc: pgsql-interfaces
Eric Marsden <emarsden@laas.fr> writes:
> When using the v3 fe/be protocol, data read and written to large
> objects via the loread and lowrite functions seems to be \\xxx
> encoded, as per literal escaping or data for the BYTEA type. For
> instance, newlines written using lowrite() are later received as
> \\012.
> [I am seeing this with my own implementation of the fe/be protocol;
> I'm not using libpq.]
It sounds to me like you have asked for textual rather than binary
results from loread.
regards, tom lane
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: large object I/O seeing \\xxx encoding with v3
@ 2004-08-13 15:39 Eric Marsden <emarsden@laas.fr>
parent: Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 4+ messages in thread
From: Eric Marsden @ 2004-08-13 15:39 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-interfaces
>>>>> "tl" == Tom Lane <tgl@sss.pgh.pa.us> writes:
ecm> When using the v3 fe/be protocol, data read and written to large
ecm> objects via the loread and lowrite functions seems to be \\xxx
ecm> encoded, as per literal escaping or data for the BYTEA type. For
ecm> instance, newlines written using lowrite() are later received as
ecm> \\012.
tl> It sounds to me like you have asked for textual rather than binary
tl> results from loread.
you're right; I am sending the type of the argument as 0, so it's text.
It seems to me that it would be more useful, and more consistent
with the way text is handled in the fe/be protocol, to use the
character encoding that was requested by the client (the equivalent
of PQsetClientEncoding) instead of this literal \xxx escaping.
Would be a backwards-incompatible change, though.
Thanks,
--
Eric Marsden <URL:http://www.laas.fr/~emarsden/;
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: large object I/O seeing \\xxx encoding with v3 protocol
@ 2004-08-13 17:49 Tom Lane <tgl@sss.pgh.pa.us>
parent: Eric Marsden <emarsden@laas.fr>
0 siblings, 0 replies; 4+ messages in thread
From: Tom Lane @ 2004-08-13 17:49 UTC (permalink / raw)
To: Eric Marsden <emarsden@laas.fr>; +Cc: pgsql-interfaces
Eric Marsden <emarsden@laas.fr> writes:
> It seems to me that it would be more useful, and more consistent
> with the way text is handled in the fe/be protocol, to use the
> character encoding that was requested by the client (the equivalent
> of PQsetClientEncoding) instead of this literal \xxx escaping.
Surely not. This is bytea data we are talking about --- there is no
reason to suppose that encoding has anything to do with it. If you
want client_encoding to take a hand, you should be storing data as text
not bytea.
regards, tom lane
^ permalink raw reply [nested|flat] 4+ messages in thread
end of thread, other threads:[~2004-08-13 17:49 UTC | newest]
Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2004-08-13 12:38 large object I/O seeing \\xxx encoding with v3 protocol Eric Marsden <emarsden@laas.fr>
2004-08-13 14:10 ` Tom Lane <tgl@sss.pgh.pa.us>
2004-08-13 15:39 ` Re: large object I/O seeing \\xxx encoding with v3 Eric Marsden <emarsden@laas.fr>
2004-08-13 17:49 ` Tom Lane <tgl@sss.pgh.pa.us>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox