diff options
| author | Tom Lane <tgl@sss.pgh.pa.us> | 2001-06-01 02:41:36 +0000 |
|---|---|---|
| committer | Tom Lane <tgl@sss.pgh.pa.us> | 2001-06-01 02:41:36 +0000 |
| commit | 0b370ea7c81228339da5a447057dbf5f874e0197 (patch) | |
| tree | 125c8590975f212a7caec6667f95f28d772bb928 /src/backend/catalog/index.c | |
| parent | a1d9d096f0f36afcdd4ca69afb41cd645b9834d2 (diff) | |
| download | postgresql-0b370ea7c81228339da5a447057dbf5f874e0197.tar.gz | |
Clean up some minor problems exposed by further thought about Panon's bug
report on old-style functions invoked by RI triggers. We had a number of
other places that were being sloppy about which memory context FmgrInfo
subsidiary data will be allocated in. Turns out none of them actually
cause a problem in 7.1, but this is for arcane reasons such as the fact
that old-style triggers aren't supported anyway. To avoid getting burnt
later, I've restructured the trigger support so that we don't keep trigger
FmgrInfo structs in relcache memory. Some other related cleanups too:
it's not really necessary to call fmgr_info at all while setting up
the index support info in relcache entries, because those ScanKeyEntry
structs are never used to invoke the functions. This should speed up
relcache initialization a tiny bit.
Diffstat (limited to 'src/backend/catalog/index.c')
| -rw-r--r-- | src/backend/catalog/index.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c index b6420a10e9..9b98bd75e9 100644 --- a/src/backend/catalog/index.c +++ b/src/backend/catalog/index.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.152 2001/05/30 20:52:32 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.153 2001/06/01 02:41:35 tgl Exp $ * * * INTERFACE ROUTINES @@ -722,6 +722,9 @@ UpdateIndexPredicate(Oid indexoid, Node *oldPred, Node *predicate) /* ---------------------------------------------------------------- * InitIndexStrategy + * + * XXX this is essentially the same as relcache.c's + * IndexedAccessMethodInitialize(), and probably ought to be merged with it. * ---------------------------------------------------------------- */ void @@ -733,18 +736,16 @@ InitIndexStrategy(int numatts, RegProcedure *support; uint16 amstrategies; uint16 amsupport; - Oid attrelid; Size strsize; /* * get information from the index relation descriptor */ - attrelid = indexRelation->rd_att->attrs[0]->attrelid; amstrategies = indexRelation->rd_am->amstrategies; amsupport = indexRelation->rd_am->amsupport; /* - * get the size of the strategy + * compute the size of the strategy array */ strsize = AttributeNumberGetIndexStrategySize(numatts, amstrategies); @@ -779,7 +780,8 @@ InitIndexStrategy(int numatts, IndexSupportInitialize(strategy, support, &indexRelation->rd_uniqueindex, - attrelid, accessMethodObjectId, + RelationGetRelid(indexRelation), + accessMethodObjectId, amstrategies, amsupport, numatts); /* |
