On Mon, 2006-03-20 at 17:53 +0300, Eugene E. wrote:
> I wrote:
>
> >> the problem is: you'll get this four byte sequence '\000' _instead_
> >> of NUL-byte anyway.
>
> You wrote:
>
> > Your client library should take care of escaping and de-escaping.
>
> We both agree as you see.
>
> Then i am asking:
> WHY should a client take care of de-escaping ? Why not to get his data
> unchanged ?
Request the data be delivered to you in binary format instead of text
format (see PQexecParams, PQexecPrepared, etc).
When you request text format it requires some escaping to occur for
obvious reasons, but you don't need to worry about the length of the
data.
When you request binary escaping is not required but you do need to
worry about the length of the data.
Pick the method that suits you best.
--