0

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.

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Iharob Al Asimi
  • 52,653
  • 6
  • 59
  • 97

1 Answers1

4

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.

Dmitri Goldring
  • 4,176
  • 2
  • 24
  • 28