]> granicus.if.org Git - postgresql/commit
Drop no-longer-needed buffers during ALTER DATABASE SET TABLESPACE.
authorTom Lane <tgl@sss.pgh.pa.us>
Tue, 4 Nov 2014 18:24:22 +0000 (13:24 -0500)
committerTom Lane <tgl@sss.pgh.pa.us>
Tue, 4 Nov 2014 18:24:22 +0000 (13:24 -0500)
commit7c6f55e9ef5d459b655a229e5dfe6cadfafcd4eb
treed76e577f391ff5159c53e876c7bce44aa50ba9de
parent8bfc2b1793ae4b27ebc4c8086117a509b4873e37
Drop no-longer-needed buffers during ALTER DATABASE SET TABLESPACE.

The previous coding assumed that we could just let buffers for the
database's old tablespace age out of the buffer arena naturally.
The folly of that is exposed by bug #11867 from Marc Munro: the user could
later move the database back to its original tablespace, after which any
still-surviving buffers would match lookups again and appear to contain
valid data.  But they'd be missing any changes applied while the database
was in the new tablespace.

This has been broken since ALTER SET TABLESPACE was introduced, so
back-patch to all supported branches.
src/backend/commands/dbcommands.c