Description
The PostgreSQLWire format serializes the result-set portion of the PostgreSQL wire protocol. It writes a
RowDescription message containing column names and types, followed by one DataRow message for each result row.
Values use their text representation, NULL values use the protocol’s null-field encoding, and booleans are written as
t or f.
This is an output-only binary format intended for clients connected through ClickHouse’s
PostgreSQL interface. The interface sets PostgreSQLWire as the session
default and uses it when the query doesn’t include an explicit FORMAT clause. An explicit clause overrides the default;
other output formats don’t produce a valid PostgreSQL result set. The interface writes the surrounding protocol messages,
such as authentication, command completion, and ready-for-query messages. PostgreSQLWire isn’t intended for displaying
or storing query results as a standalone file.
Example usage
After enabling the PostgreSQL interface, use a compatible client to execute a query:
Because the query doesn’t specify a FORMAT clause, the interface sends the result using PostgreSQLWire.
PostgreSQLWire uses the standard text-serialization settings for individual values. It has no settings specific to the
format itself; booleans are always serialized using PostgreSQL’s t and f representations. Last modified on July 27, 2026