postgresql/src/backend/commands
Tom Lane cbe9d6beb4 Fix up rickety handling of relation-truncation interlocks.
Move rd_targblock, rd_fsm_nblocks, and rd_vm_nblocks from relcache to the smgr
relation entries, so that they will get reset to InvalidBlockNumber whenever
an smgr-level flush happens.  Because we now send smgr invalidation messages
immediately (not at end of transaction) when a relation truncation occurs,
this ensures that other backends will reset their values before they next
access the relation.  We no longer need the unreliable assumption that a
VACUUM that's doing a truncation will hold its AccessExclusive lock until
commit --- in fact, we can intentionally release that lock as soon as we've
completed the truncation.  This patch therefore reverts (most of) Alvaro's
patch of 2009-11-10, as well as my marginal hacking on it yesterday.  We can
also get rid of assorted no-longer-needed relcache flushes, which are far more
expensive than an smgr flush because they kill a lot more state.

In passing this patch fixes smgr_redo's failure to perform visibility-map
truncation, and cleans up some rather dubious assumptions in freespace.c and
visibilitymap.c about when rd_fsm_nblocks and rd_vm_nblocks can be out of
date.
2010-02-09 21:43:30 +00:00
..
Makefile Support deferrable uniqueness constraints. 2009-07-29 20:56:21 +00:00
aggregatecmds.c Update copyright for the year 2010. 2010-01-02 16:58:17 +00:00
alter.c Tighten integrity checks on ALTER TABLE ... ALTER COLUMN ... RENAME. 2010-02-01 19:28:56 +00:00
analyze.c Remove old-style VACUUM FULL (which was known for a little while as 2010-02-08 04:33:55 +00:00
async.c Update copyright for the year 2010. 2010-01-02 16:58:17 +00:00
cluster.c Fix up rickety handling of relation-truncation interlocks. 2010-02-09 21:43:30 +00:00
comment.c Update copyright for the year 2010. 2010-01-02 16:58:17 +00:00
constraint.c Update copyright for the year 2010. 2010-01-02 16:58:17 +00:00
conversioncmds.c Update copyright for the year 2010. 2010-01-02 16:58:17 +00:00
copy.c Remove old-style VACUUM FULL (which was known for a little while as 2010-02-08 04:33:55 +00:00
dbcommands.c Lock database while running drop database in Hot Standby to protect 2010-01-16 14:16:31 +00:00
define.c Update copyright for the year 2010. 2010-01-02 16:58:17 +00:00
discard.c Update copyright for the year 2010. 2010-01-02 16:58:17 +00:00
explain.c Augment EXPLAIN output with more details on Hash nodes. 2010-02-01 15:43:36 +00:00
foreigncmds.c Update copyright for the year 2010. 2010-01-02 16:58:17 +00:00
functioncmds.c Remove the default_do_language parameter, instead making DO use a hardwired 2010-01-26 16:33:40 +00:00
indexcmds.c Work around deadlock problems with VACUUM FULL/CLUSTER on system catalogs, 2010-02-07 22:40:33 +00:00
lockcmds.c Update copyright for the year 2010. 2010-01-02 16:58:17 +00:00
opclasscmds.c Update copyright for the year 2010. 2010-01-02 16:58:17 +00:00
operatorcmds.c Update copyright for the year 2010. 2010-01-02 16:58:17 +00:00
portalcmds.c Update copyright for the year 2010. 2010-01-02 16:58:17 +00:00
prepare.c Update copyright for the year 2010. 2010-01-02 16:58:17 +00:00
proclang.c Update copyright for the year 2010. 2010-01-02 16:58:17 +00:00
schemacmds.c Update copyright for the year 2010. 2010-01-02 16:58:17 +00:00
sequence.c Fix up rickety handling of relation-truncation interlocks. 2010-02-09 21:43:30 +00:00
tablecmds.c Create a "relation mapping" infrastructure to support changing the relfilenodes 2010-02-07 20:48:13 +00:00
tablespace.c First part of refactoring of code for ResolveRecoveryConflict. Purposes 2010-01-14 11:08:02 +00:00
trigger.c Fix assorted core dumps and Assert failures that could occur during 2010-01-24 21:49:17 +00:00
tsearchcmds.c Update copyright for the year 2010. 2010-01-02 16:58:17 +00:00
typecmds.c Before attempting to create a composite type, check whether a type of that 2010-01-20 05:47:09 +00:00
user.c Update copyright for the year 2010. 2010-01-02 16:58:17 +00:00
vacuum.c Fix up rickety handling of relation-truncation interlocks. 2010-02-09 21:43:30 +00:00
vacuumlazy.c Fix up rickety handling of relation-truncation interlocks. 2010-02-09 21:43:30 +00:00
variable.c Update copyright for the year 2010. 2010-01-02 16:58:17 +00:00
view.c Update copyright for the year 2010. 2010-01-02 16:58:17 +00:00