Say I have a Function like this:
create function house_analysis(ingeo geometry) returns table(count_all numeric, count_important numeric) as $$ select count(*), count(*) filter (where h.import_flag) from house_table h where st_intersects(ingeo, h.geom) $$ language sql stable;
And I define a View like this:
create or replace view postzone_analysis as ( select p.zipcode, ha.count_all, ha.count_important from postzone_table p, house_analysis(p.geom) ha );
The question is:
How can I query the system catalogs (
pg_catalog.*) with my view (
postzone_analysis or its
oid) get a list of the functions used within it? Their
pg_proc.oid values are fine.
I know the database keeps track, since I cannot drop the function, but I can't find the entries in
DB is PostgreSQL 9.5.
(The real-life case is a lot more complex - it's scoped down to be lowest viable example. The view calls like 6 analysis functions, which combines the data from difference sources, and there are multiple views that are based on different area classes.)