Re: Adding comments to help understand psql hidden queries

Greg Sabino Mullane <htamfids@gmail.com>

From: Greg Sabino Mullane <htamfids@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Maiquel Grassi <grassi@hotmail.com.br>, David Christensen <david+pg@pgguru.net>, Peter Eisentraut <peter@eisentraut.org>, Jim Jones <jim.jones@uni-muenster.de>, pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2026-03-23T22:50:16Z
Lists: pgsql-hackers
Thanks for looking this over. I'm pretty happy with the patch as is now. I
agree the INTERNAL QUERY is a nice touch. I once thought about adding
"psql" into the header somehow as a kind of application_name self
labelling, but I think INTERNAL QUERY will be distinct enough.

Notably, I didn't like that some of the headers said "table" and some said
> "relation".  I made them all say "table", although you could certainly
> argue for the opposite.


I originally had "table", but then it felt weird in my testing when I was
describing a sequence or view it said table. So I'm a weak +1 for relation.

--
Cheers,
Greg

Commits

  1. Add labels to help make psql's hidden queries more understandable.