0
votes

Suppose I have created a database with non-partitioned tables and partitioned tables with their partitions as following:

 Schema |      Name       |       Type        |     Owner
--------+-----------------+-------------------+---------------
 public | cust_arr_large  | table             | admin
 public | cust_arr_medium | table             | admin
 public | cust_arr_small  | table             | admin
 public | customers       | partitioned table | admin
 public | company         | table             | admin
 public | industry        | table             | admin

The above table is the display of this command \dt.

Tables company and industry are regular tables with no partition. Table customers is a partitioned table and cust_arr_large, cust_arr_medium and cust_arr_small are its partitions.

Using SQL commands, how do I :

1 - List only the names of the regular tables and the parent partitioned tables (i.e. company, industry and customers)

2 - List only the partitions (i.e. cust_arr_small, cust_arr_medium and cust_arr_large).

\dP gives the partitioned tables - Edouard H.