i check partition information from pg_partition,
select
relname,
parttype,
parentid,
rangenum,
interval,
boundaries
from pg_partition where parttype='p';
the problem is: how to know where these partitions comes from,
i check partition information from pg_partition,
select
relname,
parttype,
parentid,
rangenum,
interval,
boundaries
from pg_partition where parttype='p';
the problem is: how to know where these partitions comes from,
If you're using greenplum, pg_partitions
has a tablename
column. See This answer
For Postgres, the name of the table that stores partition info is pg_partitioned_table
For table details that contain partitions, you may simple query pg_class
as in this answer
select c.relnamespace::regnamespace::text as schema,
c.relname as table_name,
pg_get_partkeydef(c.oid) as partition_key
from pg_class c
where c.relkind = 'p';
Here's a demo
If you want all the information of partition and their tables, you may combine the 2 tables as in this answer