Postgres provide some catalog UDFs to help DBA.
- pg_relation_filepath
- pg_stat_file
- pg_relation_filenode
- pg_filenode_relation
- ...
There are some proposals that Greenplum provide MPP-wrapper version ones.
Like gp_relation_filepath can output all results from all segments.
The usage is like:
select gp_relation_filepath(tab::regclass);
It is not easy to use it in target
list of a SQL with from exprs in GPDB:
select gp_relation_filepath(tab::regclass)
from pg_class
It needs carefully design to implement the above usage. Similar topic:
Question:
Do we still need to introduce gp_relation_filepath
that can only be used like
select gp_relation_filepath(tab::regclass);
(with empty from expr in the SQL).
Thanks!