Hi, I tested v2 on master (86f7c82cf10). It builds cleanly and the pgbench TAP tests pass. Four tests in that file fail on my machine, but they fail without the patch too.
I confirmed the bug. Neither --continue-on-error nor --max-tries helps. The old behavior was broken for text substitution as well: "SELECT 1 WHERE :nv IS NULL;" becomes "WHERE IS NULL" and fails. So I do not think anyone relies on it. One doc gap: 0001 changes what \gset does with a NULL column, but the \gset docs say nothing about NULL. One sentence is enough, so no v3 is needed. Master only, no back-patch. Please commit 0002 together with 0001. Patch 0001 says a captured NULL can be tested with IS NULL, but that test cannot tell a real NULL from a column holding the text 'NULL'. Only 0002 explains this. As CommitFest manager I am moving https://commitfest.postgresql.org/patch/7163/ to Ready for Committer, Thanks, Shihao
