How to Check wich partition contain specific rows in PostgreSQL
SELECT tableoid::pg_catalog.regclass, *
FROM <PARTITION TABLE NAME>
where <CONDITION>;
Example
SELECT tableoid::pg_catalog.regclass, *
FROM stock.request_pt0_arch
where reqid in(18844,18809,18803,18789,18785,18780,18777,18774,18770,18723,18718,18716,18714,18709,18799,18788,18779);
tableoid |id |... |
-----------------------------------+--------------------+----------+
request_pt0_p275000000 275502238 ...
request_pt0_p275000000 275593692 ...
request_pt0_p275000000 275600912 ...
request_pt0_p275000000 275622054 ...
request_pt0_p275000000 275634260 ...
request_pt0_p275000000 275943272 ...
request_pt0_p275000000 275960450 ...
request_pt0_p275000000 275985060 ...
request_pt0_p275000000 275991404 ...
request_pt0_p275000000 275993172 ...
request_pt0_p275000000 275007162 ...
request_pt0_p275000000 276115536 ...
request_pt0_p275000000 276115820 ...
request_pt0_p275000000 276142062 ...
request_pt0_p275000000 276156628 ...
request_pt0_p275000000 276211042 ...
request_pt0_p275000000 276331982 ...