[postgres] Extend wire-layer type fidelity to Integer, Double, Boolean, Date scalar columns (original) (raw)
PR #4201 narrowly fixes the round-trip regression for Long-valued scalar columns (the id() case) by advertising them as INT8 on the Postgres wire instead of VARCHAR. The remaining scalar types still collapse to VARCHAR in PostgresNetworkExecutor.getColumns():
Integer/Short/Byte→INT4Double→FLOAT8Float→FLOAT4Boolean→BOOLDate/LocalDateTime→DATE/TIMESTAMPCharacter→CHAR
Clients (psycopg, JDBC, SQLAlchemy, …) decide deserialization based on the announced column type, so the same class of bug — value round-trips as a string, parameter loop silently fails — can in principle hit any of these. The Long fix has the simplification scaffolding in place (pgType.isArrayType() || pgType == PostgresType.LONG) so adding the other types is one-line each, but each one needs:
- A round-trip integration test (engine + Postgres wire) to confirm it does not regress existing clients.
- Confirmation that the text-format serialization in
serializeAsTextproduces output the announced type's text format accepts (true/falsefor BOOL, ISO-8601 for DATE/TIMESTAMP, decimal for INT4/FLOAT8 — most are fine, but BOOL and DATE/TIMESTAMP deserve a careful audit).
Out of scope for #4201, which deliberately limited blast radius to fix the reported regression.