I created a "master table" in one tablespace, then a partition in the same tablespace and a 2nd partition in another tablespace created in a mounted NFS share.
The master table is called documents_master, and I have two child tables called documents_current and documents_old.
So, here's the layout:
table | tablespace | location
------------------+------------+------------
documents_master | public | /var/lib/postgresql/data
documents_current | public | /var/lib/postgresql/data
documents_old | old_data | /mnt/storage1
Then, I copy data from my "documents" table with the aim of filling documents_current and documents_old by issuing:
insert into documents_master select * from documents;
This fills both child tables as I expect, but when I check the disk space, everything looks like stored in the local disk.
Then, if I change the tablespace for documents_master and documents_current to the "old_data" tablespace, then insert everything again, the data is stored in the mounted partition.
Is this a bug, I'm doing something wrong?.
I'm using PostgreSQL 9.3.9 on x86_64-unknown-linux-gnu, compiled by gcc (Ubuntu 4.8.4-2ubuntu1~14.04) 4.8.4, 64-bit