aboutsummaryrefslogtreecommitdiff
path: root/src/backend/parser/parse_target.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2006-01-17 17:33:37 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2006-01-17 17:33:37 +0000
commit754da88e19e56a6aaba06a57f45fdf1b5ae792a3 (patch)
tree0dcbed1bb16054939b9f794a0637532e71f582c0 /src/backend/parser/parse_target.c
parent8372956243a477a67f1d01674c86f0285f05ccbb (diff)
downloadpostgresql-754da88e19e56a6aaba06a57f45fdf1b5ae792a3.tar.gz
postgresql-754da88e19e56a6aaba06a57f45fdf1b5ae792a3.zip
Repair problems with the result of lookup_rowtype_tupdesc() possibly being
discarded by cache flush while still in use. This is a minimal patch that just copies the tupdesc anywhere it could be needed across a flush. Applied to back branches only; Neil Conway is working on a better long-term solution for HEAD.
Diffstat (limited to 'src/backend/parser/parse_target.c')
-rw-r--r--src/backend/parser/parse_target.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/backend/parser/parse_target.c b/src/backend/parser/parse_target.c
index a6b1edbe48d..fc1ddc3dadb 100644
--- a/src/backend/parser/parse_target.c
+++ b/src/backend/parser/parse_target.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/parser/parse_target.c,v 1.129.4.1 2005/12/14 16:30:20 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/parser/parse_target.c,v 1.129.4.2 2006/01/17 17:33:34 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -839,6 +839,7 @@ ExpandIndirectionStar(ParseState *pstate, A_Indirection *ind)
/* Verify it's a composite type, and get the tupdesc */
tupleDesc = lookup_rowtype_tupdesc(exprType(expr), exprTypmod(expr));
+ tupleDesc = CreateTupleDescCopy(tupleDesc);
/* Generate a list of references to the individual fields */
numAttrs = tupleDesc->natts;
@@ -889,6 +890,8 @@ ExpandIndirectionStar(ParseState *pstate, A_Indirection *ind)
te_list = lappend(te_list, te);
}
+ FreeTupleDesc(tupleDesc);
+
return te_list;
}