I have a main prod table which I am converting to partitions and am taking a deep dive into Postgres (v14) partitioning on an isolated test system.
On the test system I have two schemas a production named part_schema and an archival schema named archive_schema. When I move a partition from the production table to the archive table the partition moves and if I query the parent archive table for the date range in the newly attached partition I can see the data is there. Also PGAdmin shows the partition under the parent in schema archive_schema and removes it from part_schema. If however I try to query the partition itself I get error 'relation does not exist' because the schema is still the 'old' one. In act I can query it under the 'old' schema. I have to move that manually. All works well but I was not expecting this.
Did I miss something when moving the partition?
select count(*)
from part_schema.mtp_202401;
select fact_id from part_schema.maintbl_part
where f_timestamp >= '2024-01-01' and f_timestamp < '2024-01-05';
alter table part_schema.maintbl_part
detach partition part_schema.mtp_202401;
-- this moves the partition to the archive parent but not the schema
alter table archive_schema.archtbl
attach partition part_schema.mtp_202401
for values from ('2024-01-01') to ('2024-02-01');
-- this gives error: 'relation does not exist'
select count(*)
from archive_schema.mtp_202401;
-- this works!!!
select count(*)
from part_schema.mtp_202401;
-- I have to do this
alter table part_schema.mtp_202401
set schema archive_schema;
-- this now works
select count(*)
from archive_schema.mtp_202401;
select *
from archive_schema.archtbl
Update:
The question was altered by one of the editors and it changed the intention of what I am seeking with this post. I started my original post as "I would appreciate someone confirming what I am doing and seeing is correct."
The work I did got me to were I wanted to, I just thought it strange that I had to do it in two steps. I understand that UI's can be present an optimised, more organised view. Thank you to all who commented.

