PostgreSQL – How to List Tables Used by A View
To list the tables used by a view in PostgreSQL, you can query the system catalog to inspect the view’s underlying SQL query. PostgreSQL stores view definitions in the pg_views system catalog table. Here’s how you can retrieve the tables used by a specific view: SELECT table_name FROM information_schema.tables WHERE table_schema = ‘public’ AND table_name…