BUG #17767: psql: tab-completion causes warnings when standard_conforming_strings = off - Mailing list pgsql-bugs

From PG Bug reporting form
Subject BUG #17767: psql: tab-completion causes warnings when standard_conforming_strings = off
Date
Msg-id 17767-e5c80c3e56ded85c@postgresql.org
Whole thread Raw
Responses Re: BUG #17767: psql: tab-completion causes warnings when standard_conforming_strings = off  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
The following bug has been logged on the website:

Bug reference:      17767
Logged by:          Takuya Aramaki
Email address:      takaram71@gmail.com
PostgreSQL version: 15.1
Operating system:   Debian bullseye
Description:

Hello,

I unexpectedly got some warning messages when using tab-completion of
psql.
I only face this issue with psql 15, not with v14.

Step to reproduce:
1. Set standard_conforming_strings = off
2. Type `\d _` and press Tab key

Actual result:
Got `WARNING:  nonstandard use of \\ in a string literal`

Expected result:
No warning messages

Below is my console log when I reproduced this issue with the official
docker image.

~~~
$ docker run --rm --name postgres -e POSTGRES_PASSWORD=pass -d
postgres:15.1
67361a066d40c8f98af6e21028839a2b6a9852dceaaf3d01c3e8c06ffae91d2e
$ docker exec -it postgres psql -h localhost -U postgres
psql (15.1 (Debian 15.1-1.pgdg110+1))
Type "help" for help.

postgres=# SET standard_conforming_strings = off;
SET
postgres=# \d _WARNING:  nonstandard use of \\ in a string literal
LINE 1: ...FROM pg_catalog.pg_class c WHERE (c.relname) LIKE '\\_%' AND...
                                                             ^
HINT:  Use the escape string syntax for backslashes, e.g., E'\\'.
WARNING:  nonstandard use of \\ in a string literal
LINE 3: ...OM pg_catalog.pg_namespace n WHERE n.nspname LIKE '\\_%' AND...
                                                             ^
HINT:  Use the escape string syntax for backslashes, e.g., E'\\'.
~~~

Thank you.


pgsql-bugs by date:

Previous
From: John Naylor
Date:
Subject: Re: BUG #17766: Issue in asc, limit and offset for pagination.
Next
From: hubert depesz lubaczewski
Date:
Subject: Re: BUG #17766: Issue in asc, limit and offset for pagination.