PostgreSQL
Prev | Chapter 64. Frontend/Backend Protocol | Next

# Message Data Types

This section describes the base data types used in messages.

Int`n`(`i`)

  An `n` bit integer in network byte order. If `i` is specified it is the literal value. Eg. Int16, Int32(42).

LimString`n`(`s`)

  A character array of exactly `n` bytes interpreted as a '\0' terminated string. The '\0' is omitted if there is insufficient room. If `s` is specified it is the literal value. Eg. LimString32, LimString64("user").

String(`s`)

  A conventional C '\0' terminated string with no length limitation. If `s` is specified it is the literal value. Eg. String, String("user").

  > Note: There is no predefined limit on the length of a string that can be returned by the backend. Good coding strategy for a frontend is to use an expandable buffer so that anything that fits in memory can be accepted. If that's not feasible, read the full string and discard trailing characters that don't fit into your fixed-size buffer.

Byte`n`(`c`)

  Exactly `n` bytes. If `c` is specified it is the literal value. Eg. Byte, Byte1('\n').

Prev | Home | Next
Protocol | Up | Message Formats