File: protocol-message-types.html

package info (click to toggle)
pgadmin3 1.4.3-2
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 29,796 kB
  • ctags: 10,758
  • sloc: cpp: 55,356; sh: 6,164; ansic: 1,520; makefile: 576; sql: 482; xml: 100; perl: 18
file content (57 lines) | stat: -rw-r--r-- 3,589 bytes parent folder | download
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>43.3.Message Data Types</title>
<link rel="stylesheet" href="stylesheet.css" type="text/css">
<link rev="made" href="pgsql-docs@postgresql.org">
<meta name="generator" content="DocBook XSL Stylesheets V1.70.0">
<link rel="start" href="index.html" title="PostgreSQL 8.1.4 Documentation">
<link rel="up" href="protocol.html" title="Chapter43.Frontend/Backend Protocol">
<link rel="prev" href="protocol-flow.html" title="43.2.Message Flow">
<link rel="next" href="protocol-message-formats.html" title="43.4.Message Formats">
<link rel="copyright" href="ln-legalnotice.html" title="Legal Notice">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="sect1" lang="en">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="protocol-message-types"></a>43.3.Message Data Types</h2></div></div></div>
<p>This section describes the base data types used in messages.

</p>
<div class="variablelist"><dl>
<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" style="margin-left: 0.5in; margin-right: 0.5in;">
<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></body>
</html>