]> granicus.if.org Git - postgresql/commit
When a relation is moved to another tablespace, we can't assume that we can
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>
Tue, 7 Oct 2008 11:15:48 +0000 (11:15 +0000)
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>
Tue, 7 Oct 2008 11:15:48 +0000 (11:15 +0000)
commit3c66048adbdc0ab95b9f8e8efc55eb6cb65dca08
tree1fa805462b75f9fdc2a4354e4043ff278902d390
parent260fc8d5c728b918393972ee8bfb145f2f3549b5
When a relation is moved to another tablespace, we can't assume that we can
use the old relfilenode in the new tablespace. There might be another relation
in the new tablespace with the same relfilenode, so we must generate a fresh
relfilenode in the new tablespace.

The 8.3 patch to let deleted relation files linger as zero-length files until
the next checkpoint made this more obvious: moving a relation from one table
space another, and then back again, caused a collision with the lingering
file.

Back-patch to 8.1. The issue is present in 8.0 as well, but it doesn't seem
worth fixing there, because we didn't have protection from OID collisions
after OID wraparound before 8.1.

Report by Guillaume Lelarge.
src/backend/commands/tablecmds.c