pg.ddx.io pgsql-general@postgresql.org mailing list archive
help / color / mirror / Atom feedHow to get partition info for a partition table?
2+ messages / 2 participants
[nested] [flat]
* How to get partition info for a partition table?
@ 2018-10-26 17:37 Yuxia Qiu <yuxiaqiu1@gmail.com>
2018-10-27 13:01 ` Re: How to get partition info for a partition table? legrand legrand <legrand_legrand@hotmail.com>
0 siblings, 1 reply; 2+ messages in thread
From: Yuxia Qiu @ 2018-10-26 17:37 UTC (permalink / raw)
To: pgsql-general@lists.postgresql.org
HI Dear PostgreSQL,
I am pretty new for this DB.
I have created two partition tables as bellow:
*CREATE TABLE* measurement_year_month (
logdate date not null,
peaktemp int,
unitsales int
) PARTITION BY RANGE (EXTRACT(YEAR FROM logdate), EXTRACT(MONTH FROM
logdate));
*create table* partitionTest(
firstname varchar[20],
lastName varchar[20],
id int
)
partition by range (id, firstname);
*My question is:* how do I retrieve the information like bellow?
*Table name* *Partition type * * Partition
information*
measurement_year_month Range (EXTRACT(YEAR FROM
logdate), EXTRACT(MONTH FROM logdate)
partitionTest Range (id,
firstname)
Thanks in advance.
Regards,
Yuxia
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: How to get partition info for a partition table?
2018-10-26 17:37 How to get partition info for a partition table? Yuxia Qiu <yuxiaqiu1@gmail.com>
@ 2018-10-27 13:01 ` legrand legrand <legrand_legrand@hotmail.com>
0 siblings, 0 replies; 2+ messages in thread
From: legrand legrand @ 2018-10-27 13:01 UTC (permalink / raw)
To: pgsql-general
see
https://www.postgresql.org/docs/9.5/static/app-psql.html
for psql options an commands:
psql -d ... -U ...
\d+ measurement_year_month
...
Partition key: RANGE (date_part('year'::text, logdate),
date_part('month'::text, logdate))
Number of partitions: 0
if you want to know how postgresql is retrieving those informations
try -E option for ECHO_HIDDEN
psql -d ... -U ... -E
\d+ measurement_year_month
--
Sent from: http://www.postgresql-archive.org/PostgreSQL-general-f1843780.html
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2018-10-27 13:01 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2018-10-26 17:37 How to get partition info for a partition table? Yuxia Qiu <yuxiaqiu1@gmail.com>
2018-10-27 13:01 ` legrand legrand <legrand_legrand@hotmail.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox