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 58 59 60 61 62 63 64 65 66
|
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>28.9.Control Functions</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="libpq.html" title="Chapter28.libpq - C Library">
<link rel="prev" href="libpq-copy.html" title="28.8.Functions Associated with the COPY Command">
<link rel="next" href="libpq-notice-processing.html" title="28.10.Notice Processing">
<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="libpq-control"></a>28.9.Control Functions</h2></div></div></div>
<p>These functions control miscellaneous details of
<span class="application">libpq</span>'s behavior.</p>
<div class="variablelist"><dl>
<dt><span class="term"><code class="function">PQsetErrorVerbosity</code><a name="id685358"></a></span></dt>
<dd>
<p>Determines the verbosity of messages returned by
<code class="function">PQerrorMessage</code> and <code class="function">PQresultErrorMessage</code>.
</p>
<pre class="synopsis">typedef enum {
PQERRORS_TERSE,
PQERRORS_DEFAULT,
PQERRORS_VERBOSE
} PGVerbosity;
PGVerbosity PQsetErrorVerbosity(PGconn *conn, PGVerbosity verbosity);</pre>
<p>
<code class="function">PQsetErrorVerbosity</code> sets the verbosity mode, returning
the connection's previous setting. In <em class="firstterm">TERSE</em> mode,
returned messages include severity, primary text, and position only;
this will normally fit on a single line. The default mode produces
messages that include the above plus any detail, hint, or context
fields (these may span multiple lines). The <em class="firstterm">VERBOSE</em>
mode includes all available fields. Changing the verbosity does not
affect the messages available from already-existing
<code class="structname">PGresult</code> objects, only subsequently-created ones.</p>
</dd>
<dt><span class="term"><code class="function">PQtrace</code><a name="id685426"></a></span></dt>
<dd>
<p> Enables tracing of the client/server communication to a debugging file stream.
</p>
<pre class="synopsis">void PQtrace(PGconn *conn, FILE *stream);</pre>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Note</h3>
<p>On Windows, if the <span class="application">libpq</span> library and an application are
compiled with different flags, this function call will crash the
application because the internal representation of the <code class="literal">FILE</code>
pointers differ. Specifically, multithreaded/single-threaded,
release/debug, and static/dynamic flags should be the same for the
library and all applications using that library.</p>
</div>
</dd>
<dt><span class="term"><code class="function">PQuntrace</code><a name="id685474"></a></span></dt>
<dd>
<p> Disables tracing started by <code class="function">PQtrace</code>.
</p>
<pre class="synopsis">void PQuntrace(PGconn *conn);</pre>
</dd>
</dl></div>
</div></body>
</html>
|