Re: Make psql ignore trailing semicolons in \sf, \ef, etc

2024-01-10 Thread Tom Lane
Laurenz Albe writes: > On Mon, 2024-01-08 at 15:48 -0500, Tom Lane wrote: >> Is this enough of a bug to deserve back-patching? I'm not sure. > I like the patch, but I wouldn't back-patch it. I'd call the current > behavior a slight inconsistency rather than an outright bug, and I think > that

Re: Make psql ignore trailing semicolons in \sf, \ef, etc

2024-01-09 Thread Tristan Partin
On Mon Jan 8, 2024 at 6:08 PM CST, Tom Lane wrote: "Tristan Partin" writes: > On Mon Jan 8, 2024 at 2:48 PM CST, Tom Lane wrote: >> +(isascii((unsigned char) mybuf.data[mybuf.len - 1]) && >> +

Re: Make psql ignore trailing semicolons in \sf, \ef, etc

2024-01-08 Thread Laurenz Albe
On Mon, 2024-01-08 at 15:48 -0500, Tom Lane wrote: > Is this enough of a bug to deserve back-patching? I'm not sure. I like the patch, but I wouldn't back-patch it. I'd call the current behavior a slight inconsistency rather than an outright bug, and I think that we should be conservative with

Re: Make psql ignore trailing semicolons in \sf, \ef, etc

2024-01-08 Thread Tom Lane
"Tristan Partin" writes: > On Mon Jan 8, 2024 at 2:48 PM CST, Tom Lane wrote: >> +(isascii((unsigned char) >> mybuf.data[mybuf.len - 1]) && >> + isspace((unsigned char) >> mybuf.data[mybuf.len -

Re: Make psql ignore trailing semicolons in \sf, \ef, etc

2024-01-08 Thread Tristan Partin
On Mon Jan 8, 2024 at 2:48 PM CST, Tom Lane wrote: We had a complaint (see [1], but it's not the first IIRC) about how psql doesn't behave very nicely if one ends \sf or allied commands with a semicolon: regression=# \sf sin(float8); ERROR: expected a right parenthesis This is a bit of a

Make psql ignore trailing semicolons in \sf, \ef, etc

2024-01-08 Thread Tom Lane
We had a complaint (see [1], but it's not the first IIRC) about how psql doesn't behave very nicely if one ends \sf or allied commands with a semicolon: regression=# \sf sin(float8); ERROR: expected a right parenthesis This is a bit of a usability gotcha, since many other backslash commands are