OSDN Git Service

Fix problem reported by Alex Korn: if a relation has been dropped and
authorTom Lane <tgl@sss.pgh.pa.us>
Fri, 2 Nov 2001 16:30:29 +0000 (16:30 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Fri, 2 Nov 2001 16:30:29 +0000 (16:30 +0000)
commit7d05310828aae801fd1483e638771a4034cbecd7
tree6362bc6eb2738bcd93c7ecffa6e3a4e94dad75be
parent5d4b94085eda499b090dc019b821607065ce5745
Fix problem reported by Alex Korn: if a relation has been dropped and
recreated since the start of our transaction, our first reference to it
errored out because we'd try to reuse our old relcache entry for it.
Do this by accepting SI inval messages just before relcache search in
heap_openr, so that dead relcache entries will be flushed before we
search.  Also, break heap_open/openr into two pairs of routines,
relation_open(r) and heap_open(r).  The relation_open routines make
no tests on relkind and so can be used to open anything that has a
pg_class entry.  The heap_open routines are wrappers that add a relkind
test to preserve their established behavior.  Use the relation_open
routines in several places that had various kluge solutions for opening
rels that might be either heap or index rels.

Also, remove the old 'heap stats' code that's been superseded by Jan's
stats collector, and clean up some inconsistencies in error reporting
between the different types of ALTER TABLE.
14 files changed:
src/backend/access/heap/Makefile
src/backend/access/heap/heapam.c
src/backend/access/heap/stats.c [deleted file]
src/backend/access/index/indexam.c
src/backend/catalog/index.c
src/backend/commands/command.c
src/backend/commands/comment.c
src/backend/commands/rename.c
src/backend/parser/parse_func.c
src/backend/utils/init/postinit.c
src/include/access/genam.h
src/include/access/heapam.h
src/test/regress/expected/errors.out
src/test/regress/expected/temp.out