gooderp18绿色标准版
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
5.2KB

  1. <?xml version="1.0" encoding="UTF-8" standalone="no"?>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>START TRANSACTION</title><link rel="stylesheet" type="text/css" href="stylesheet.css" /><link rev="made" href="pgsql-docs@lists.postgresql.org" /><meta name="generator" content="DocBook XSL Stylesheets V1.79.1" /><link rel="prev" href="sql-show.html" title="SHOW" /><link rel="next" href="sql-truncate.html" title="TRUNCATE" /></head><body><div xmlns="http://www.w3.org/TR/xhtml1/transitional" class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="5" align="center">START TRANSACTION</th></tr><tr><td width="10%" align="left"><a accesskey="p" href="sql-show.html" title="SHOW">Prev</a> </td><td width="10%" align="left"><a accesskey="u" href="sql-commands.html" title="SQL Commands">Up</a></td><th width="60%" align="center">SQL Commands</th><td width="10%" align="right"><a accesskey="h" href="index.html" title="PostgreSQL 12.4 Documentation">Home</a></td><td width="10%" align="right"> <a accesskey="n" href="sql-truncate.html" title="TRUNCATE">Next</a></td></tr></table><hr></hr></div><div class="refentry" id="SQL-START-TRANSACTION"><div class="titlepage"></div><a id="id-1.9.3.179.1" class="indexterm"></a><div class="refnamediv"><h2><span class="refentrytitle">START TRANSACTION</span></h2><p>START TRANSACTION — start a transaction block</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><pre class="synopsis">
  3. START TRANSACTION [ <em class="replaceable"><code>transaction_mode</code></em> [, ...] ]
  4. <span class="phrase">where <em class="replaceable"><code>transaction_mode</code></em> is one of:</span>
  5. ISOLATION LEVEL { SERIALIZABLE | REPEATABLE READ | READ COMMITTED | READ UNCOMMITTED }
  6. READ WRITE | READ ONLY
  7. [ NOT ] DEFERRABLE
  8. </pre></div><div class="refsect1" id="id-1.9.3.179.5"><h2>Description</h2><p>
  9. This command begins a new transaction block. If the isolation level,
  10. read/write mode, or deferrable mode is specified, the new transaction has those
  11. characteristics, as if <a class="xref" href="sql-set-transaction.html" title="SET TRANSACTION"><span class="refentrytitle">SET TRANSACTION</span></a> was executed. This is the same
  12. as the <a class="xref" href="sql-begin.html" title="BEGIN"><span class="refentrytitle">BEGIN</span></a> command.
  13. </p></div><div class="refsect1" id="id-1.9.3.179.6"><h2>Parameters</h2><p>
  14. Refer to <a class="xref" href="sql-set-transaction.html" title="SET TRANSACTION"><span class="refentrytitle">SET TRANSACTION</span></a> for information on the meaning
  15. of the parameters to this statement.
  16. </p></div><div class="refsect1" id="id-1.9.3.179.7"><h2>Compatibility</h2><p>
  17. In the standard, it is not necessary to issue <code class="command">START TRANSACTION</code>
  18. to start a transaction block: any SQL command implicitly begins a block.
  19. <span class="productname">PostgreSQL</span>'s behavior can be seen as implicitly
  20. issuing a <code class="command">COMMIT</code> after each command that does not
  21. follow <code class="command">START TRANSACTION</code> (or <code class="command">BEGIN</code>),
  22. and it is therefore often called <span class="quote">“<span class="quote">autocommit</span>”</span>.
  23. Other relational database systems might offer an autocommit feature
  24. as a convenience.
  25. </p><p>
  26. The <code class="literal">DEFERRABLE</code>
  27. <em class="replaceable"><code>transaction_mode</code></em>
  28. is a <span class="productname">PostgreSQL</span> language extension.
  29. </p><p>
  30. The SQL standard requires commas between successive <em class="replaceable"><code>transaction_modes</code></em>, but for historical
  31. reasons <span class="productname">PostgreSQL</span> allows the commas to be
  32. omitted.
  33. </p><p>
  34. See also the compatibility section of <a class="xref" href="sql-set-transaction.html" title="SET TRANSACTION"><span class="refentrytitle">SET TRANSACTION</span></a>.
  35. </p></div><div class="refsect1" id="id-1.9.3.179.8"><h2>See Also</h2><span class="simplelist"><a class="xref" href="sql-begin.html" title="BEGIN"><span class="refentrytitle">BEGIN</span></a>, <a class="xref" href="sql-commit.html" title="COMMIT"><span class="refentrytitle">COMMIT</span></a>, <a class="xref" href="sql-rollback.html" title="ROLLBACK"><span class="refentrytitle">ROLLBACK</span></a>, <a class="xref" href="sql-savepoint.html" title="SAVEPOINT"><span class="refentrytitle">SAVEPOINT</span></a>, <a class="xref" href="sql-set-transaction.html" title="SET TRANSACTION"><span class="refentrytitle">SET TRANSACTION</span></a></span></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="sql-show.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="sql-commands.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="sql-truncate.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">SHOW </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> TRUNCATE</td></tr></table></div></body></html>
上海开阖软件有限公司 沪ICP备12045867号-1