Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 1d1f425

Browse files
committed
Add note that PREPARE TRANSACTION is for transaction managers, not
regular applications. Also add a comment pointing out that tab-complition for PREPARE TRANSACTION is missing on purpose.
1 parent e7dcfd0 commit 1d1f425

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

doc/src/sgml/ref/prepare_transaction.sgml

+10-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$PostgreSQL: pgsql/doc/src/sgml/ref/prepare_transaction.sgml,v 1.9 2009/04/23 00:23:45 tgl Exp $
2+
$PostgreSQL: pgsql/doc/src/sgml/ref/prepare_transaction.sgml,v 1.10 2010/01/25 18:23:10 heikki Exp $
33
PostgreSQL documentation
44
-->
55

@@ -82,6 +82,15 @@ PREPARE TRANSACTION <replaceable class="PARAMETER">transaction_id</replaceable>
8282
<refsect1>
8383
<title>Notes</title>
8484

85+
<para>
86+
<command>PREPARE TRANSACTION</> is not intended for use in applications
87+
or interactive sessions. It's purpose is to allow an external
88+
transaction manager to perform atomic global transactions across multiple
89+
databases or other transactional resources. Unless you're writing a
90+
transaction manager, you probably shouldn't be using <command>PREPARE
91+
TRANSACTION</>.
92+
</para>
93+
8594
<para>
8695
This command must be used inside a transaction block. Use <xref
8796
linkend="sql-begin" endterm="sql-begin-title"> to start one.

src/bin/psql/tab-complete.c

+6-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* Copyright (c) 2000-2010, PostgreSQL Global Development Group
55
*
6-
* $PostgreSQL: pgsql/src/bin/psql/tab-complete.c,v 1.191 2010/01/22 16:40:19 rhaas Exp $
6+
* $PostgreSQL: pgsql/src/bin/psql/tab-complete.c,v 1.192 2010/01/25 18:23:09 heikki Exp $
77
*/
88

99
/*----------------------------------------------------------------------
@@ -1882,6 +1882,11 @@ psql_completion(char *text, int start, int end)
18821882
COMPLETE_WITH_LIST(list_PREPARE);
18831883
}
18841884

1885+
/*
1886+
* PREPARE TRANSACTION is missing on purpose. It's intended for transaction
1887+
* managers, not for manual use in interactive sessions.
1888+
*/
1889+
18851890
/* REASSIGN OWNED BY xxx TO yyy */
18861891
else if (pg_strcasecmp(prev_wd, "REASSIGN") == 0)
18871892
COMPLETE_WITH_CONST("OWNED");

0 commit comments

Comments
 (0)