postgresql/doc/src/sgml/ref/end.sgml

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

113 lines
2.6 KiB
Plaintext
Raw Normal View History

<!--
2010-09-20 22:08:53 +02:00
doc/src/sgml/ref/end.sgml
PostgreSQL documentation
-->
<refentry id="sql-end">
<indexterm zone="sql-end">
<primary>END</primary>
</indexterm>
<refmeta>
<refentrytitle>END</refentrytitle>
<manvolnum>7</manvolnum>
<refmiscinfo>SQL - Language Statements</refmiscinfo>
</refmeta>
2003-04-27 01:56:51 +02:00
<refnamediv>
2003-04-27 01:56:51 +02:00
<refname>END</refname>
<refpurpose>commit the current transaction</refpurpose>
</refnamediv>
<refsynopsisdiv>
2003-04-27 01:56:51 +02:00
<synopsis>
END [ WORK | TRANSACTION ] [ AND [ NO ] CHAIN ]
2003-04-27 01:56:51 +02:00
</synopsis>
</refsynopsisdiv>
2003-04-27 01:56:51 +02:00
<refsect1>
<title>Description</title>
<para>
2003-04-27 01:56:51 +02:00
<command>END</command> commits the current transaction. All changes
made by the transaction become visible to others and are guaranteed
2003-09-12 02:12:47 +02:00
to be durable if a crash occurs. This command is a
<productname>PostgreSQL</productname> extension
Improve <xref> vs. <command> formatting in the documentation SQL commands are generally marked up as <command>, except when a link to a reference page is used using <xref>. But the latter doesn't create monospace markup, so this looks strange especially when a paragraph contains a mix of links and non-links. We considered putting <command> in the <refentrytitle> on the target side, but that creates some formatting side effects elsewhere. Generally, it seems safer to solve this on the link source side. We can't put the <xref> inside the <command>; the DTD doesn't allow this. DocBook 5 would allow the <command> to have the linkend attribute itself, but we are not there yet. So to solve this for now, convert the <xref>s to <link> plus <command>. This gives the correct look and also gives some more flexibility what we can put into the link text (e.g., subcommands or other clauses). In the future, these could then be converted to DocBook 5 style. I haven't converted absolutely all xrefs to SQL command reference pages, only those where we care about the appearance of the link text or where it was otherwise appropriate to make the appearance match a bit better. Also in some cases, the links where repetitive, so in those cases the links where just removed and replaced by a plain <command>. In cases where we just want the link and don't specifically care about the generated link text (typically phrased "for further information see <xref ...>") the xref is kept. Reported-by: Dagfinn Ilmari Mannsåker <ilmari@ilmari.org> Discussion: https://www.postgresql.org/message-id/flat/87o8pco34z.fsf@wibble.ilmari.org
2020-10-03 16:16:51 +02:00
that is equivalent to <link linkend="sql-commit"><command>COMMIT</command></link>.
</para>
2003-04-27 01:56:51 +02:00
</refsect1>
2003-04-27 01:56:51 +02:00
<refsect1>
<title>Parameters</title>
2003-04-27 01:56:51 +02:00
<variablelist>
<varlistentry>
<term><literal>WORK</literal></term>
<term><literal>TRANSACTION</literal></term>
<listitem>
<para>
Optional key words. They have no effect.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>AND CHAIN</literal></term>
<listitem>
<para>
If <literal>AND CHAIN</literal> is specified, a new transaction is
immediately started with the same transaction characteristics (see <xref
linkend="sql-set-transaction"/>) as the just finished one. Otherwise,
no new transaction is started.
</para>
</listitem>
</varlistentry>
2003-04-27 01:56:51 +02:00
</variablelist>
</refsect1>
2003-04-27 01:56:51 +02:00
<refsect1>
<title>Notes</title>
<para>
Improve <xref> vs. <command> formatting in the documentation SQL commands are generally marked up as <command>, except when a link to a reference page is used using <xref>. But the latter doesn't create monospace markup, so this looks strange especially when a paragraph contains a mix of links and non-links. We considered putting <command> in the <refentrytitle> on the target side, but that creates some formatting side effects elsewhere. Generally, it seems safer to solve this on the link source side. We can't put the <xref> inside the <command>; the DTD doesn't allow this. DocBook 5 would allow the <command> to have the linkend attribute itself, but we are not there yet. So to solve this for now, convert the <xref>s to <link> plus <command>. This gives the correct look and also gives some more flexibility what we can put into the link text (e.g., subcommands or other clauses). In the future, these could then be converted to DocBook 5 style. I haven't converted absolutely all xrefs to SQL command reference pages, only those where we care about the appearance of the link text or where it was otherwise appropriate to make the appearance match a bit better. Also in some cases, the links where repetitive, so in those cases the links where just removed and replaced by a plain <command>. In cases where we just want the link and don't specifically care about the generated link text (typically phrased "for further information see <xref ...>") the xref is kept. Reported-by: Dagfinn Ilmari Mannsåker <ilmari@ilmari.org> Discussion: https://www.postgresql.org/message-id/flat/87o8pco34z.fsf@wibble.ilmari.org
2020-10-03 16:16:51 +02:00
Use <link linkend="sql-rollback"><command>ROLLBACK</command></link> to
2003-04-27 01:56:51 +02:00
abort a transaction.
</para>
2003-09-12 02:12:47 +02:00
<para>
Issuing <command>END</command> when not inside a transaction does
2003-09-12 02:12:47 +02:00
no harm, but it will provoke a warning message.
</para>
2003-04-27 01:56:51 +02:00
</refsect1>
<refsect1>
<title>Examples</title>
2003-04-27 01:56:51 +02:00
<para>
To commit the current transaction and make all changes permanent:
<programlisting>
END;
</programlisting></para>
</refsect1>
2003-04-27 01:56:51 +02:00
<refsect1>
<title>Compatibility</title>
2003-04-27 01:56:51 +02:00
<para>
<command>END</command> is a <productname>PostgreSQL</productname>
Improve <xref> vs. <command> formatting in the documentation SQL commands are generally marked up as <command>, except when a link to a reference page is used using <xref>. But the latter doesn't create monospace markup, so this looks strange especially when a paragraph contains a mix of links and non-links. We considered putting <command> in the <refentrytitle> on the target side, but that creates some formatting side effects elsewhere. Generally, it seems safer to solve this on the link source side. We can't put the <xref> inside the <command>; the DTD doesn't allow this. DocBook 5 would allow the <command> to have the linkend attribute itself, but we are not there yet. So to solve this for now, convert the <xref>s to <link> plus <command>. This gives the correct look and also gives some more flexibility what we can put into the link text (e.g., subcommands or other clauses). In the future, these could then be converted to DocBook 5 style. I haven't converted absolutely all xrefs to SQL command reference pages, only those where we care about the appearance of the link text or where it was otherwise appropriate to make the appearance match a bit better. Also in some cases, the links where repetitive, so in those cases the links where just removed and replaced by a plain <command>. In cases where we just want the link and don't specifically care about the generated link text (typically phrased "for further information see <xref ...>") the xref is kept. Reported-by: Dagfinn Ilmari Mannsåker <ilmari@ilmari.org> Discussion: https://www.postgresql.org/message-id/flat/87o8pco34z.fsf@wibble.ilmari.org
2020-10-03 16:16:51 +02:00
extension that provides functionality equivalent to <link
linkend="sql-commit"><command>COMMIT</command></link>, which is
2003-04-27 01:56:51 +02:00
specified in the SQL standard.
</para>
</refsect1>
2003-09-12 02:12:47 +02:00
<refsect1>
<title>See Also</title>
<simplelist type="inline">
<member><xref linkend="sql-begin"/></member>
<member><xref linkend="sql-commit"/></member>
<member><xref linkend="sql-rollback"/></member>
2003-09-12 02:12:47 +02:00
</simplelist>
</refsect1>
</refentry>