I've noticed that two variables in RelationCopyStorage() are defined in ascope higher than necessary. Please see the patch.
-- Antonin HouskaWeb: https://www.cybertec-postgresql.com