Re: Adding comments to help understand psql hidden queries
David Christensen <david+pg@pgguru.net>
From: David Christensen <david+pg@pgguru.net>
To: Greg Sabino Mullane <htamfids@gmail.com>
Cc: Peter Eisentraut <peter@eisentraut.org>,
Jim Jones <jim.jones@uni-muenster.de>, pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2024-04-03T17:16:05Z
Lists: pgsql-hackers
Attachments
- v4-0001-Improve-SQL-comments-on-echo-hidden-output.patch (application/octet-stream) patch v4-0001
I got Greg's blessing on squashing the commits down, and now including a v4 with additional improvements on the output formatting front. Main changes: - all generated comments are the same width - width has been bumped to 80 - removed _() functions for consumers of the new output functions This patch adds two new helper functions, OutputComment() and OutputCommentStars() to output and wrap the comments to the appropriate widths. Everything should continue to work just fine if we want to adjust the width by just adjusting the MAX_COMMENT_WIDTH symbol. I removed _() in the output of the query/stars since there'd be no sensible existing translations for the constructed string, which included the query string itself. If we need it for the "QUERY" string, this could be added fairly easily, but the existing piece would have been nonsensical and never used in practice. Thanks, David
Commits
-
Add labels to help make psql's hidden queries more understandable.
- 41d69e6dccad 19 (unreleased) landed