@marsupilami @Mark @Fr0st
Text vs. Binary / Correctnes vs. Speed
Following this thread and another one I opened it is obvious that the current implemention of the Postgresql driver has bugs while interfacing with other components (ZMemTable, Grids etc..). With your help it was pinned down to the way the binary data is being parsed into pascal aware types.
After researching the issue for the last couple of days, it looks like this parsing issue cannot be
fully resolved. As there are many types, just for example:
- User defined Compound types
- Arrays
- Range types
- Geometries (from PostGis)
The nice people of PostgreSQL are fully aware of this issue! the wire protocol supports the mixing of both text and binary data for the same result set. But (and this is a big but) libpq.dll doesn't. It only supports text or binary.
Native drivers (like in .NET/JAVA) do support mixed mode. But unfortently this is not feasable in our case to write a native driver. While others that depends on the client library default to text mode (like psycopg for python)
I bealive that something should work correctly before it will work fast. So it should seriously be considered to revert back to the text protocol.
That being said, I'll check over the coming weeks what does it mean to
keep the binary mode: how to covert types like polygon and ranges, and what to do with unknown types (any suggestions would be great)
Thank you all
.NET driver and the excat conversation we are just having:
https://github.com/npgsql/npgsql/issues/447
https://github.com/npgsql/npgsql/issues/370
A 10 years old effort to add mixed mode to libpq (never happen) :
https://www.postgresql.org/message-id/D ... wien.gv.at
PQexecParams - see the resultFormat param:
https://www.postgresql.org/docs/current ... ELECT-INFO