How to retrieve the partition info for each partition table?

From: Yuxia Qiu <yuxiaqiu1(at)gmail(dot)com>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: How to retrieve the partition info for each partition table?
Date: 2018-10-24 17:29:21
Message-ID: CAJ0a2RkkmBYEtqek5sKR-f19HS_hKjUf3KLZU7TASiZ9Z-MQLw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

HI,

I have created some partition table, as example bellow:
CREATE TABLE public.measurement
(
city_id integer NOT NULL,
logdate date NOT NULL,
peaktemp integer,
unitsales integer
) PARTITION BY RANGE (logdate) ;

CREATE TABLE public.measurement_y2006m02 PARTITION OF public.measurement
FOR VALUES FROM ('2006-02-01') TO ('2006-03-01');

CREATE TABLE public.measurement_y2006m03 PARTITION OF public.measurement
FOR VALUES FROM ('2006-03-01') TO ('2006-04-01');

I know how to get a list partition tables for above example by calling :

SELECT i.inhrelid::regclass AS child

FROM pg_inherits i

WHERE i.inhparent = 'public.measurement'::regclass;

My question is: how to get the value boundary for each partition table like
bellow?

measurement_y2006m02 FROM ('2006-02-01') TO ('2006-03-01')

measurement_y2006m03 FROM ('2006-03-01') TO ('2006-04-01')

Thanks,

Yuxia

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Igor Neyman 2018-10-24 18:19:25 RE: How to retrieve the partition info for each partition table?
Previous Message Boris Sagadin 2018-10-24 17:11:59 Re: Postgres 10, slave not catching up with master