BUG #17767: psql: tab-completion causes warnings when standard_conforming_strings = off

From: PG Bug reporting form <noreply(at)postgresql(dot)org>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Cc: takaram71(at)gmail(dot)com
Subject: BUG #17767: psql: tab-completion causes warnings when standard_conforming_strings = off
Date: 2023-02-01 09:45:39
Message-ID: 17767-e5c80c3e56ded85c@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 17767
Logged by: Takuya Aramaki
Email address: takaram71(at)gmail(dot)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.

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message hubert depesz lubaczewski 2023-02-01 11:10:57 Re: BUG #17766: Issue in asc, limit and offset for pagination.
Previous Message John Naylor 2023-02-01 09:12:54 Re: BUG #17766: Issue in asc, limit and offset for pagination.