diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2006-01-17 17:33:37 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2006-01-17 17:33:37 +0000 |
commit | 754da88e19e56a6aaba06a57f45fdf1b5ae792a3 (patch) | |
tree | 0dcbed1bb16054939b9f794a0637532e71f582c0 /src/backend/utils/cache | |
parent | 8372956243a477a67f1d01674c86f0285f05ccbb (diff) | |
download | postgresql-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/utils/cache')
-rw-r--r-- | src/backend/utils/cache/typcache.c | 4 |
1 files changed, 3 insertions, 1 deletions
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) |