Someone once mentioned a way to make Postgres verbose, so that if you did \dt it would display all the underlying SQL.
I thought it was connected with -a or -e to echo the SQL, but I was wrong. I seem to have forgotten that method and have tried to look it up without any luck:
http://www.postgresql.org/docs/current/static/app-psql.html
I thought because this was database/sql related it was for stackoverflow, but this may need to be moved to [Super Users|Server Fault|Database Administrators] (?)
To show the queries of internal commands,
Method 1 : psql -E - including -E option while opening the console.
Method 2 : \set ECHO_HIDDEN noexec/on/off, can be used while in session. noexec means it doesn't run the query, just prints it.
snipped from the output of psql --help:
-e, --echo-queries echo commands sent to server
-E, --echo-hidden display queries that internal commands generate
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With