On 12nd of September 2017, Tom Lane committed patch: Add psql variables to track success/failure of SQL queries. This patch adds ERROR, SQLSTATE, and ROW_COUNT, which are updated after every query, as well as LAST_ERROR_MESSAGE and LAST_ERROR_SQLSTATE, which are updated only when a query ...

On 5th of September 2017, Tom Lane committed patch: Add \gdesc psql command. This command acts somewhat like \g, but instead of executing the query buffer, it merely prints a description of the columns that the query result would have. (Of course, this ...

On 30th of March 2017, Tom Lane committed patch: Support \if ... \elif ... \else ... \endif in psql scripting. This patch adds nestable conditional blocks to psql. The control structure feature per se is complete, but the boolean expressions understood by \if ...

On 7th of March, Stephen Frost committed patch: psql: Add \gx command It can often be useful to use expanded mode output (\x) for just a single query. Introduce a \gx which acts exactly like \g except that it will force expanded output ...

Lately at least two people on irc asked questions similar to "how do I know how many queries there are in database, per second?". So, let's see what we can find out.

On 8th of April, Alvaro Herrera committed patch: Support \crosstabview in psql \crosstabview is a completely different way to display results from a query: instead of a vertical display of rows, the data values are placed in a grid where the column and row ...

On 4th of April, Tom Lane committed patch: Add a \gexec command to psql for evaluation of computed queries. \gexec executes the just-entered query, like \g, but instead of printing the results it takes each field as a SQL command to send to ...

On 8th of December, Robert Haas committed patch: psql: Support multiple -c and -f options, and allow mixing them. To support this, we must reconcile some historical anomalies in the behavior of -c. In particular, as a backward-incompatibility, -c no longer implies --no-psqlrc. Pavel ...

On 7th of July, Andres Freund committed patch: Add psql PROMPT variable showing the pid of the connected to backend. The substitution for the pid is %p. Author: Julien Rouhaud Discussion: 116262CF971C844FB6E793F8809B51C6E99D48@BPXM02GP.gisp.nec.co.jp

On 3rd of July, Tom Lane committed patch: Add psql \ev and \sv commands for editing and showing view definitions. These are basically just like the \ef and \sf commands for functions. Petr Korobeinikov, reviewed by Jeevan Chalke, some changes by me