The pg_partition_columns system view is used to show the partition key columns of a partitioned table.

    columntypereferencesdescription
    schemanamename The name of the schema the partitioned table is in.
    tablenamename The table name of the top-level parent table.
    columnnamename The name of the partition key column.
    partitionlevelsmallint The level of this subpartition in the hierarchy.
    position_in_partition_keyinteger For list partitions you can have a composite (multi-column) partition key. This shows the position of the column in a composite key.

    Parent topic: System Catalogs Definitions