<parameter>portalName</parameter> can be <literal>""</literal> or
<symbol>NULL</symbol> to reference the unnamed portal. It is fine
if no portal exists with this name, in that case the operation is a
no-op. On success, a <structname>PGresult</structname> with status
<literal>PGRES_COMMAND_OK</literal> is returned.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
<para>
The <structname>PGresult</structname><indexterm><primary>PGresult</primary></indexterm>
structure encapsulates the result returned by the server.
<application>libpq</application> application programmers should be
careful to maintain the <structname>PGresult</structname> abstraction.
Use the accessor functions below to get at the contents of
<structname>PGresult</structname>. Avoid directly referencing the
fields of the <structname>PGresult</structname> structure because they
are subject to change in the future.
<variablelist>
<varlistentry id="libpq-PQresultStatus">
<term><function>PQresultStatus</function><indexterm><primary>PQresultStatus</primary></indexterm></term>
<listitem>
<para>
Returns the result status of the command.
<synopsis>
ExecStatusType PQresultStatus(const PGresult *res);
</synopsis>
</para>
<para>
<xref linkend="libpq-PQresultStatus"/> can return one of the following values:
<variablelist>
<varlistentry id="libpq-pgres-empty-query">
<term><literal>PGRES_EMPTY_QUERY</literal></term>
<listitem>
<para>
The string sent to the server was empty.
</para>
</listitem>
</varlistentry>
<varlistentry id="libpq-pgres-command-ok">
<term><literal>PGRES_COMMAND_OK</literal></term>
<listitem>
<para>
Successful completion of a command returning no data.
</para>
</listitem>
</varlistentry>
<varlistentry id="libpq-pgres-tuples-ok">
<term><literal>PGRES_TUPLES_OK</literal></term>
<listitem>
<para>
Successful completion of a command returning data (such as
a <command>SELECT</command> or <command>SHOW</command>).
</para>
</listitem>
</varlistentry>
<varlistentry id="libpq-pgres-copy-out">
<term><literal>PGRES_COPY_OUT</literal></term>
<listitem>
<para>
Copy Out (from server) data transfer started.
</para>
</listitem>
</varlistentry>
<varlistentry id="libpq-pgres-copy-in">
<term><literal>PGRES_COPY_IN</literal></term>
<listitem>
<para>
Copy In (to server) data transfer started.
</para>
</listitem>
</varlistentry>
<varlistentry id="libpq-pgres-bad-response">
<term><literal>PGRES_BAD_RESPONSE</literal></term>
<listitem>
<para>
The server's response was not understood.
</para>
</listitem>
</varlistentry>
<varlistentry id="libpq-pgres-nonfatal-error">
<term><literal>PGRES_NONFATAL_ERROR</literal></term>
<listitem>
<para>
A nonfatal error (a notice or warning) occurred.
</para>
</listitem>
</varlistentry>
<varlistentry id="libpq-pgres-fatal-error">
<term><literal>PGRES_FATAL_ERROR</literal></term>
<listitem>
<para>
A fatal error occurred.
</para>
</listitem>
</varlistentry>
<varlistentry id="libpq-pgres-copy-both">
<term><literal>PGRES_COPY_BOTH</literal></term>
<listitem>
<para>
Copy In/Out (to and from server) data transfer started. This
feature is currently used only for