1999-07-22 17:09:15 +02:00
|
|
|
<!--
|
2010-09-20 22:08:53 +02:00
|
|
|
doc/src/sgml/ref/end.sgml
|
2001-12-08 04:24:40 +01:00
|
|
|
PostgreSQL documentation
|
1999-07-22 17:09:15 +02:00
|
|
|
-->
|
|
|
|
|
2017-10-20 03:16:39 +02:00
|
|
|
<refentry id="sql-end">
|
2014-02-24 03:25:35 +01:00
|
|
|
<indexterm zone="sql-end">
|
|
|
|
<primary>END</primary>
|
|
|
|
</indexterm>
|
|
|
|
|
1999-07-22 17:09:15 +02:00
|
|
|
<refmeta>
|
2010-04-03 09:23:02 +02:00
|
|
|
<refentrytitle>END</refentrytitle>
|
2008-11-14 11:22:48 +01:00
|
|
|
<manvolnum>7</manvolnum>
|
1999-07-22 17:09:15 +02:00
|
|
|
<refmiscinfo>SQL - Language Statements</refmiscinfo>
|
|
|
|
</refmeta>
|
2003-04-27 01:56:51 +02:00
|
|
|
|
1999-07-22 17:09:15 +02:00
|
|
|
<refnamediv>
|
2003-04-27 01:56:51 +02:00
|
|
|
<refname>END</refname>
|
|
|
|
<refpurpose>commit the current transaction</refpurpose>
|
|
|
|
</refnamediv>
|
|
|
|
|
1999-07-22 17:09:15 +02:00
|
|
|
<refsynopsisdiv>
|
2003-04-27 01:56:51 +02:00
|
|
|
<synopsis>
|
2019-03-24 10:33:14 +01:00
|
|
|
END [ WORK | TRANSACTION ] [ AND [ NO ] CHAIN ]
|
2003-04-27 01:56:51 +02:00
|
|
|
</synopsis>
|
1999-07-22 17:09:15 +02:00
|
|
|
</refsynopsisdiv>
|
2010-11-23 21:27:50 +01:00
|
|
|
|
2003-04-27 01:56:51 +02:00
|
|
|
<refsect1>
|
|
|
|
<title>Description</title>
|
1999-07-22 17:09:15 +02:00
|
|
|
|
|
|
|
<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>.
|
1999-07-22 17:09:15 +02:00
|
|
|
</para>
|
2003-04-27 01:56:51 +02:00
|
|
|
</refsect1>
|
2010-11-23 21:27:50 +01:00
|
|
|
|
2003-04-27 01:56:51 +02:00
|
|
|
<refsect1>
|
|
|
|
<title>Parameters</title>
|
1999-07-22 17:09:15 +02:00
|
|
|
|
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>
|
2019-03-24 10:33:14 +01:00
|
|
|
|
|
|
|
<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>
|
1999-07-22 17:09:15 +02:00
|
|
|
</refsect1>
|
2003-04-27 01:56:51 +02:00
|
|
|
|
|
|
|
<refsect1>
|
|
|
|
<title>Notes</title>
|
1999-07-22 17:09:15 +02:00
|
|
|
|
|
|
|
<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>
|
2017-10-09 03:44:17 +02:00
|
|
|
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>
|
1999-07-22 17:09:15 +02:00
|
|
|
|
2003-04-27 01:56:51 +02:00
|
|
|
<para>
|
|
|
|
To commit the current transaction and make all changes permanent:
|
|
|
|
<programlisting>
|
|
|
|
END;
|
2011-08-07 09:49:45 +02:00
|
|
|
</programlisting></para>
|
1999-07-22 17:09:15 +02:00
|
|
|
</refsect1>
|
|
|
|
|
2003-04-27 01:56:51 +02:00
|
|
|
<refsect1>
|
|
|
|
<title>Compatibility</title>
|
2010-11-23 21:27:50 +01:00
|
|
|
|
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>
|
1999-07-22 17:09:15 +02:00
|
|
|
</refsect1>
|
2003-09-12 02:12:47 +02:00
|
|
|
|
|
|
|
<refsect1>
|
|
|
|
<title>See Also</title>
|
|
|
|
|
|
|
|
<simplelist type="inline">
|
2017-11-23 15:39:47 +01:00
|
|
|
<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>
|
1999-07-22 17:09:15 +02:00
|
|
|
</refentry>
|