postgres db files - which file represents the specific table/index?

后端 未结 3 1115
心在旅途
心在旅途 2021-01-11 11:23

when i go into sql-8.2/base/ to check how much space does my table take, there are plenty of files named by a number. how can i find the specific file which sto

3条回答
  •  不知归路
    2021-01-11 12:06

    select pg_relation_filepath('OID or name of a table, index, sequence, or toast table');
    

    For example:

    select pg_relation_filepath('flush_history');
    Returns base/83780/153211 which you will find in your data directory.
    

    http://www.postgresql.org/docs/current/static/functions-admin.html

提交回复
热议问题