From 754da88e19e56a6aaba06a57f45fdf1b5ae792a3 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Tue, 17 Jan 2006 17:33:37 +0000 Subject: 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. --- src/backend/utils/cache/typcache.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/backend/utils/cache/typcache.c') diff --git a/src/backend/utils/cache/typcache.c b/src/backend/utils/cache/typcache.c index 7e15f884f61..b719f99d82d 100644 --- a/src/backend/utils/cache/typcache.c +++ b/src/backend/utils/cache/typcache.c @@ -36,7 +36,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/utils/cache/typcache.c,v 1.11 2004/12/31 22:01:25 pgsql Exp $ + * $PostgreSQL: pgsql/src/backend/utils/cache/typcache.c,v 1.11.4.1 2006/01/17 17:33:35 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -383,6 +383,8 @@ lookup_default_opclass(Oid type_id, Oid am_id) * * Note: returned TupleDesc points to cached copy; caller must copy it * if intending to scribble on it or keep a reference for a long time. + * ("A long time" basically means "across any possible cache flush", + * which typically could occur at any relation open or catalog lookup.) */ TupleDesc lookup_rowtype_tupdesc(Oid type_id, int32 typmod) -- cgit v1.2.3