diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2006-06-16 18:42:24 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2006-06-16 18:42:24 +0000 |
commit | 06e10abc0bb4297a0754313b4f158bdd5622ca24 (patch) | |
tree | 6d413dfdfab3fea4a6d96b07b7fdb8ba81498860 /src/backend/parser/parse_coerce.c | |
parent | b49ce32da1975b2fdab26e463b7189b95e770809 (diff) | |
download | postgresql-06e10abc0bb4297a0754313b4f158bdd5622ca24.tar.gz postgresql-06e10abc0bb4297a0754313b4f158bdd5622ca24.zip |
Fix problems with cached tuple descriptors disappearing while still in use
by creating a reference-count mechanism, similar to what we did a long time
ago for catcache entries. The back branches have an ugly solution involving
lots of extra copies, but this way is more efficient. Reference counting is
only applied to tupdescs that are actually in caches --- there seems no need
to use it for tupdescs that are generated in the executor, since they'll go
away during plan shutdown by virtue of being in the per-query memory context.
Neil Conway and Tom Lane
Diffstat (limited to 'src/backend/parser/parse_coerce.c')
-rw-r--r-- | src/backend/parser/parse_coerce.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/backend/parser/parse_coerce.c b/src/backend/parser/parse_coerce.c index 3f5d8563f60..bbf3c8aab7f 100644 --- a/src/backend/parser/parse_coerce.c +++ b/src/backend/parser/parse_coerce.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/parser/parse_coerce.c,v 2.138 2006/04/22 01:25:59 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/parser/parse_coerce.c,v 2.139 2006/06/16 18:42:22 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -772,6 +772,8 @@ coerce_record_to_complex(ParseState *pstate, Node *node, format_type_be(targetTypeId)), errdetail("Input has too many columns."))); + ReleaseTupleDesc(tupdesc); + rowexpr = makeNode(RowExpr); rowexpr->args = newargs; rowexpr->row_typeid = targetTypeId; |