Skip to content
Advertisement

Get number of partitions in PostgreSQL database

What is the most efficient way to get the number of partitions created in the database?

I am using PostgreSQL API for C++.

Advertisement

Answer

This is how you can select all the names of the table partitions:

It can be used to count as well:

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement