[postgres] Extend wire-layer type fidelity to Integer, Double, Boolean, Date scalar columns (original) (raw)

Follow-up to #4200 / #4201.

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():

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:

  1. A round-trip integration test (engine + Postgres wire) to confirm it does not regress existing clients.
  2. Confirmation that the text-format serialization in serializeAsText produces output the announced type's text format accepts (true/false for 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.