Re: PQescapeBytea is not multibyte aware - Mailing list pgsql-hackers

From Tom Lane
Subject Re: PQescapeBytea is not multibyte aware
Date
Msg-id 10929.1018049103@sss.pgh.pa.us
Whole thread Raw
In response to Re: PQescapeBytea is not multibyte aware  (Joe Conway <mail@joeconway.com>)
List pgsql-hackers
Joe Conway <mail@joeconway.com> writes:
> But still, doesn't that mean roughly twice as much memory usage for each
> copy of the string? And I seem to remember Jan saying that each datum
> winds up having 4 copies in memory. It ends up impacting the practical
> length limit for a bytea value.

Well, once the data actually reaches Datum form it'll be in internal
representation, hence compact.  I'm not sure how many copies the parser
will make in the process of casting to UNKNOWN and then to bytea, but
I'm not terribly concerned by the above argument.

> Wow. I didn't realize this was possible:

> test=# select X'ffff';
>   ?column?
> ----------
>      65535
> (1 row)

> This does clearly conflict with the spec, but what about backward
> compatibility? Do you think many people use this capability?

No idea.  I don't think it's documented anywhere, though...
        regards, tom lane


pgsql-hackers by date:

Previous
From: Jeff Davis
Date:
Subject: Re: Suggestion for optimization
Next
From: Tom Lane
Date:
Subject: Re: Suggestion for optimization