blob: e769a6b2958c23092b2235d9c48f40b83c2643cf (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>55.6. Message Data Types</title><link rel="stylesheet" type="text/css" href="stylesheet.css" /><link rev="made" href="pgsql-docs@lists.postgresql.org" /><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot" /><link rel="prev" href="protocol-logical-replication.html" title="55.5. Logical Streaming Replication Protocol" /><link rel="next" href="protocol-message-formats.html" title="55.7. Message Formats" /></head><body id="docContent" class="container-fluid col-10"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="5" align="center">55.6. Message Data Types</th></tr><tr><td width="10%" align="left"><a accesskey="p" href="protocol-logical-replication.html" title="55.5. Logical Streaming Replication Protocol">Prev</a> </td><td width="10%" align="left"><a accesskey="u" href="protocol.html" title="Chapter 55. Frontend/Backend Protocol">Up</a></td><th width="60%" align="center">Chapter 55. Frontend/Backend Protocol</th><td width="10%" align="right"><a accesskey="h" href="index.html" title="PostgreSQL 15.7 Documentation">Home</a></td><td width="10%" align="right"> <a accesskey="n" href="protocol-message-formats.html" title="55.7. Message Formats">Next</a></td></tr></table><hr /></div><div class="sect1" id="PROTOCOL-MESSAGE-TYPES"><div class="titlepage"><div><div><h2 class="title" style="clear: both">55.6. Message Data Types</h2></div></div></div><p>
This section describes the base data types used in messages.
</p><div class="variablelist"><dl class="variablelist"><dt><span class="term">Int<em class="replaceable"><code>n</code></em>(<em class="replaceable"><code>i</code></em>)</span></dt><dd><p>
An <em class="replaceable"><code>n</code></em>-bit integer in network byte
order (most significant byte first).
If <em class="replaceable"><code>i</code></em> is specified it
is the exact value that will appear, otherwise the value
is variable. Eg. Int16, Int32(42).
</p></dd><dt><span class="term">Int<em class="replaceable"><code>n</code></em>[<em class="replaceable"><code>k</code></em>]</span></dt><dd><p>
An array of <em class="replaceable"><code>k</code></em>
<em class="replaceable"><code>n</code></em>-bit integers, each in network
byte order. The array length <em class="replaceable"><code>k</code></em>
is always determined by an earlier field in the message.
Eg. Int16[M].
</p></dd><dt><span class="term">String(<em class="replaceable"><code>s</code></em>)</span></dt><dd><p>
A null-terminated string (C-style string). There is no
specific length limitation on strings.
If <em class="replaceable"><code>s</code></em> is specified it is the exact
value that will appear, otherwise the value is variable.
Eg. String, String("user").
</p><div class="note"><h3 class="title">Note</h3><p>
<span class="emphasis"><em>There is no predefined limit</em></span> 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.
</p></div></dd><dt><span class="term">Byte<em class="replaceable"><code>n</code></em>(<em class="replaceable"><code>c</code></em>)</span></dt><dd><p>
Exactly <em class="replaceable"><code>n</code></em> bytes. If the field
width <em class="replaceable"><code>n</code></em> is not a constant, it is
always determinable from an earlier field in the message.
If <em class="replaceable"><code>c</code></em> is specified it is the exact
value. Eg. Byte2, Byte1('\n').
</p></dd></dl></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="protocol-logical-replication.html" title="55.5. Logical Streaming Replication Protocol">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="protocol.html" title="Chapter 55. Frontend/Backend Protocol">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="protocol-message-formats.html" title="55.7. Message Formats">Next</a></td></tr><tr><td width="40%" align="left" valign="top">55.5. Logical Streaming Replication Protocol </td><td width="20%" align="center"><a accesskey="h" href="index.html" title="PostgreSQL 15.7 Documentation">Home</a></td><td width="40%" align="right" valign="top"> 55.7. Message Formats</td></tr></table></div></body></html>
|