OSDN Git Service

Assorted cleanups in preparation for using a map file to support altering
authorTom Lane <tgl@sss.pgh.pa.us>
Wed, 3 Feb 2010 01:14:17 +0000 (01:14 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Wed, 3 Feb 2010 01:14:17 +0000 (01:14 +0000)
commit70a2b05a59c02464e36d8c9bf23d2eef8502eccd
tree367ea4f6b3285ec31e88868276f27524fc495674
parentab7c49c98811f539db9294c8f2d1a15380e025f6
Assorted cleanups in preparation for using a map file to support altering
the relfilenode of currently-not-relocatable system catalogs.

1. Get rid of inval.c's dependency on relfilenode, by not having it emit
smgr invalidations as a result of relcache flushes.  Instead, smgr sinval
messages are sent directly from smgr.c when an actual relation delete or
truncate is done.  This makes considerably more structural sense and allows
elimination of a large number of useless smgr inval messages that were
formerly sent even in cases where nothing was changing at the
physical-relation level.  Note that this reintroduces the concept of
nontransactional inval messages, but that's okay --- because the messages
are sent by smgr.c, they will be sent in Hot Standby slaves, just from a
lower logical level than before.

2. Move setNewRelfilenode out of catalog/index.c, where it never logically
belonged, into relcache.c; which is a somewhat debatable choice as well but
better than before.  (I considered catalog/storage.c, but that seemed too
low level.)  Rename to RelationSetNewRelfilenode.

3. Cosmetic cleanups of some other relfilenode manipulations.
src/backend/catalog/heap.c
src/backend/catalog/index.c
src/backend/catalog/toasting.c
src/backend/commands/tablecmds.c
src/backend/storage/smgr/smgr.c
src/backend/utils/cache/inval.c
src/backend/utils/cache/relcache.c
src/include/catalog/index.h
src/include/utils/inval.h
src/include/utils/relcache.h