Re: pgsql: Binary data support improvement
Hi Matteo,
2013/7/2 Matteo Beccati <[email protected]>
> > AFAIK, PDO doesn't handle bytea data natively.
>
> It does, as far as I remember. See PDO::PARAM_LOB
>
> We could easily (and transparently) use binary for the parameters
> explicitly bound as LOB, but I see no way we can use binary for results
> -- which usually is the most common operation. Maybe it's better than
> nothing though?
The API is not for ease of use, but for better performance as it eliminate
needless hex conversions on both server and client side.
>
> > There may be clever usage, but binary support is only for faster bytea
> > handling.
> > API isn't great, so if there are objections, I'll spend time rather than
> > this.
>
> I think the API would become cumbersome and error-prone, although I see
> the benefits in bytea-intensive scenarios.
>
Right.
My vote is: +0
>
> If we only could figure out a better API, that could turn into a +1...
Since libpq does not support API that selectively return binary type,
there won't be any better API. We may wait until PostgreSQL supports
better API.
There may be better API in the future.
I'll close applicable bug reports as "won't fix".
Regards,
--
Yasuo Ohgaki
[email protected]
Thread (10 messages)