aboutsummaryrefslogtreecommitdiff
path: root/src/backend/parser/analyze.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2002-10-21 22:06:20 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2002-10-21 22:06:20 +0000
commit200b15161556a2bc6e6b0cccd08be1ca3a438643 (patch)
treec520e1a6420f079c6b87594bd9687031f8e8ecc4 /src/backend/parser/analyze.c
parentf724c164d3b9194555a7a7ee10bbb4bfb63caa7a (diff)
downloadpostgresql-200b15161556a2bc6e6b0cccd08be1ca3a438643.tar.gz
postgresql-200b15161556a2bc6e6b0cccd08be1ca3a438643.zip
Fix places that were using IsTransactionBlock() as an (inadequate) check
that they'd get to commit immediately on finishing. There's now a centralized routine PreventTransactionChain() that implements the necessary tests.
Diffstat (limited to 'src/backend/parser/analyze.c')
-rw-r--r--src/backend/parser/analyze.c22
1 files changed, 1 insertions, 21 deletions
diff --git a/src/backend/parser/analyze.c b/src/backend/parser/analyze.c
index c8ed3ed8cb2..30c8e8f15b9 100644
--- a/src/backend/parser/analyze.c
+++ b/src/backend/parser/analyze.c
@@ -6,7 +6,7 @@
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Header: /cvsroot/pgsql/src/backend/parser/analyze.c,v 1.252 2002/10/20 00:31:53 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/parser/analyze.c,v 1.253 2002/10/21 22:06:19 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -1631,16 +1631,6 @@ transformSelectStmt(ParseState *pstate, SelectStmt *stmt)
if (stmt->forUpdate)
elog(ERROR, "DECLARE/UPDATE is not supported"
"\n\tCursors must be READ ONLY");
-
- /*
- * 15 august 1991 -- since 3.0 postgres does locking right, we
- * discovered that portals were violating locking protocol. portal
- * locks cannot span xacts. as a short-term fix, we installed the
- * check here. -- mao
- */
- if (!IsTransactionBlock())
- elog(ERROR, "DECLARE CURSOR may only be used in begin/end transaction blocks");
-
qry->into = makeNode(RangeVar);
qry->into->relname = stmt->portalname;
qry->isPortal = TRUE;
@@ -1849,16 +1839,6 @@ transformSetOperationStmt(ParseState *pstate, SelectStmt *stmt)
if (forUpdate)
elog(ERROR, "DECLARE/UPDATE is not supported"
"\n\tCursors must be READ ONLY");
-
- /*
- * 15 august 1991 -- since 3.0 postgres does locking right, we
- * discovered that portals were violating locking protocol. portal
- * locks cannot span xacts. as a short-term fix, we installed the
- * check here. -- mao
- */
- if (!IsTransactionBlock())
- elog(ERROR, "DECLARE CURSOR may only be used in begin/end transaction blocks");
-
qry->into = makeNode(RangeVar);
qry->into->relname = portalname;
qry->isPortal = TRUE;