It is possible in PostgreSQL 11 to display the partition table for each row in the table? Well, it's clear that the assignment of partitions is always known by the declarative definition but is there any way to get this information programmatically?

1 Answer 1


This is possible by using the system column tableoid:

select *, tableoid::regclass as partition_name
from the_table;

Online example

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.