Reputation: 53006
Is it possible to get the names or (Oid's) for all queried tables with libpq? If there exists a generic standard SQL way i would prefer it.
Upvotes: 0
Views: 312
Reputation: 4363
It's not standard, but the Postgres EXPLAIN command can give you (more than) what you want.
http://www.postgresql.org/docs/9.3/static/sql-explain.html
If you use the JSON output format, the table names are found in the "Relation Name" attributes of the "Plan" objects.
Upvotes: 4