PostgreSQL: Find a Table location using pg_relation_filepath

PostgreSQL stores relation information in a separate file by using OID. You can find a list of those files in the PostgreSQL data directory.

It creates a file for relation like table, index, sequence and toast table. As it stores with OID (Object ID), then it’s hard to locate a particular relation file.

Once you get the OID and location of your table, you can quickly estimate other items like a size of a table, FSM file, VM file, toast information.

You can access few related articles:
What is FSM?
What is VM?
What is toast?

Use pg_relation_filepath() to get a location of your table:


Please share your ideas and opinions about this topic with me, your contribution will add true value to this topic.
If anyone has doubts on this topic then please do let me know by leaving comments or send me an email.

If you like this post, then please share it with others.
Please follow dbrnd.com, I will share my experience towards the success of Database Research and Development Activity.

I put up a post every day, please keep reading and learning.
Discover Yourself, Happy Blogging !
Anvesh M. Patel.

More from dbrnd.com

Leave a Reply

Be the First to Comment!

Notify of
avatar
wpDiscuz