Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com> writes:
> The trivial fix is to just force a checkpoint in ALTER TABLE SET
> TABLESPACE. Can we do better than that? Perhaps only force a checkpoint
> when we find that the file already exists.
If ALTER TABLE SET TABLESPACE is assuming that it can always use the
same relfilenode number in the new space as in the old, it's just plain
broken. We need to fix that assumption.
regards, tom lane