postgres protocol - ghdrako/doc_snipets GitHub Wiki
PostgreSQL’s messaging protocol say how long the data is in the data itself.
Each response can be made up of multiple message types, for example the result of a SELECT statement will be a RowDescription message which returns the field name and type of each column, then a DataRow message for each row in the result, followed by a CommandComplete message. Having a message for each row makes it easier for the client to start parsing and processing large results while they are still being received