0

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?

Paul White
95.3k30 gold badges439 silver badges689 bronze badges
asked Nov 29, 2019 at 12:51

1 Answer 1

3

This is possible by using the system column tableoid:

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

Online example

answered Nov 29, 2019 at 13:07

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.