pgsql: Fix psql's behavior with \g for a multiple-command string.

2022-10-03 Thread Tom Lane
Fix psql's behavior with \g for a multiple-command string. The pre-v15 behavior was to discard all but the last result, but with the new behavior of printing all results by default, we will send each such result to the \g file. However, we're still opening and closing the \g file for each result,

pgsql: Fix psql's behavior with \g for a multiple-command string.

2022-10-03 Thread Tom Lane
Fix psql's behavior with \g for a multiple-command string. The pre-v15 behavior was to discard all but the last result, but with the new behavior of printing all results by default, we will send each such result to the \g file. However, we're still opening and closing the \g file for each result,