diff options
author | Robert Haas <rhaas@postgresql.org> | 2011-07-18 11:02:48 -0400 |
---|---|---|
committer | Robert Haas <rhaas@postgresql.org> | 2011-07-18 11:04:43 -0400 |
commit | 367bc426a1c22b9f6badb06cd41fc438fd034639 (patch) | |
tree | eb518f0e9399e0857f0e5f79c10750e1bfdaf909 /src/backend/utils/cache/relcache.c | |
parent | 8f8a273c4d2433de57f6f0356f44ab47b7387641 (diff) | |
download | postgresql-367bc426a1c22b9f6badb06cd41fc438fd034639.tar.gz postgresql-367bc426a1c22b9f6badb06cd41fc438fd034639.zip |
Avoid index rebuild for no-rewrite ALTER TABLE .. ALTER TYPE.
Noah Misch. Review and minor cosmetic changes by me.
Diffstat (limited to 'src/backend/utils/cache/relcache.c')
-rw-r--r-- | src/backend/utils/cache/relcache.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/backend/utils/cache/relcache.c b/src/backend/utils/cache/relcache.c index 0b9d77a61d2..809222bfe95 100644 --- a/src/backend/utils/cache/relcache.c +++ b/src/backend/utils/cache/relcache.c @@ -2395,6 +2395,7 @@ RelationBuildLocalRelation(const char *relname, Oid relnamespace, TupleDesc tupDesc, Oid relid, + Oid relfilenode, Oid reltablespace, bool shared_relation, bool mapped_relation, @@ -2529,10 +2530,8 @@ RelationBuildLocalRelation(const char *relname, /* * Insert relation physical and logical identifiers (OIDs) into the right - * places. Note that the physical ID (relfilenode) is initially the same - * as the logical ID (OID); except that for a mapped relation, we set - * relfilenode to zero and rely on RelationInitPhysicalAddr to consult the - * map. + * places. For a mapped relation, we set relfilenode to zero and rely on + * RelationInitPhysicalAddr to consult the map. */ rel->rd_rel->relisshared = shared_relation; @@ -2547,10 +2546,10 @@ RelationBuildLocalRelation(const char *relname, { rel->rd_rel->relfilenode = InvalidOid; /* Add it to the active mapping information */ - RelationMapUpdateMap(relid, relid, shared_relation, true); + RelationMapUpdateMap(relid, relfilenode, shared_relation, true); } else - rel->rd_rel->relfilenode = relid; + rel->rd_rel->relfilenode = relfilenode; RelationInitLockInfo(rel); /* see lmgr.c */ |