went wrong.
The message string is processed in just the same way as for
<function>errmsg</function>.
</para>
</listitem>
<listitem>
<para>
<function>errhint_plural(const char *fmt_singular, const char *fmt_plural,
unsigned long n, ...)</function> is like <function>errhint</function>, but with
support for various plural forms of the message.
For more information see <xref linkend="nls-guidelines"/>.
</para>
</listitem>
<listitem>
<para>
<function>errcontext(const char *msg, ...)</function> is not normally called
directly from an <function>ereport</function> message site; rather it is used
in <literal>error_context_stack</literal> callback functions to provide
information about the context in which an error occurred, such as the
current location in a PL function.
The message string is processed in just the same way as for
<function>errmsg</function>. Unlike the other auxiliary functions, this can
be called more than once per <function>ereport</function> call; the successive
strings thus supplied are concatenated with separating newlines.
</para>
</listitem>
<listitem>
<para>
<function>errposition(int cursorpos)</function> specifies the textual location
of an error within a query string. Currently it is only useful for
errors detected in the lexical and syntactic analysis phases of
query processing.
</para>
</listitem>
<listitem>
<para>
<function>errtable(Relation rel)</function> specifies a relation whose
name and schema name should be included as auxiliary fields in the error
report.
</para>
</listitem>
<listitem>
<para>
<function>errtablecol(Relation rel, int attnum)</function> specifies
a column whose name, table name, and schema name should be included as
auxiliary fields in the error report.
</para>
</listitem>
<listitem>
<para>
<function>errtableconstraint(Relation rel, const char *conname)</function>
specifies a table constraint whose name, table name, and schema name
should be included as auxiliary fields in the error report. Indexes
should be considered to be constraints for this purpose, whether or
not they have an associated <structname>pg_constraint</structname> entry. Be
careful to pass the underlying heap relation, not the index itself, as
<literal>rel</literal>.
</para>
</listitem>
<listitem>
<para>
<function>errdatatype(Oid datatypeOid)</function> specifies a data
type whose name and schema name should be included as auxiliary fields
in the error report.
</para>
</listitem>
<listitem>
<para>
<function>errdomainconstraint(Oid datatypeOid, const char *conname)</function>
specifies a domain constraint whose name, domain name, and schema name
should be included as auxiliary fields in the error report.
</para>
</listitem>
<listitem>
<para>
<function>errcode_for_file_access()</function> is a convenience function that
selects an appropriate SQLSTATE error identifier for a failure in a
file-access-related system call. It uses the saved
<literal>errno</literal> to determine which error code to generate.
Usually this should be used in combination with <literal>%m</literal> in the
primary error message text.
</para>
</listitem>
<listitem>
<para>
<function>errcode_for_socket_access()</function> is a convenience function that
selects an appropriate SQLSTATE error identifier for a failure in a
socket-related system call.
</para>
</listitem>
<listitem>
<para>
<function>errhidestmt(bool hide_stmt)</function> can be called to specify
suppression of the <literal>STATEMENT:</literal> portion of a message in the
postmaster log. Generally this is appropriate if the message text
includes the current statement already.
</para>