From e81bf4882ad4ced655d10a4d65b222aba066d4db Mon Sep 17 00:00:00 2001 From: Shihao Date: Sun, 20 Sep 2026 14:48:21 -0400 Subject: [PATCH v1] doc: fix format() example output for a value with a backslash The example says that format('INSERT INTO %I VALUES(%L)', 'locations', 'C:\Program Files') returns INSERT INTO locations VALUES('C:\Program Files'). A backslash makes quote_literal emit an escape string constant, so the real output is INSERT INTO locations VALUES(E'C:\\Program Files'). Reported-by: Yury Saburov Discussion: https://postgr.es/m/178979714249.1241.1230833804069549466%40wrigleys.postgresql.org Backpatch-through: 14 --- doc/src/sgml/func/func-string.sgml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/src/sgml/func/func-string.sgml b/doc/src/sgml/func/func-string.sgml index fb7408ee014..941ebd3cd68 100644 --- a/doc/src/sgml/func/func-string.sgml +++ b/doc/src/sgml/func/func-string.sgml @@ -1773,7 +1773,7 @@ SELECT format('INSERT INTO %I VALUES(%L)', 'Foo bar', E'O\'Reilly'); Result: INSERT INTO "Foo bar" VALUES('O''Reilly') SELECT format('INSERT INTO %I VALUES(%L)', 'locations', 'C:\Program Files'); -Result: INSERT INTO locations VALUES('C:\Program Files') +Result: INSERT INTO locations VALUES(E'C:\\Program Files') -- 2.37.1 (Apple Git-137.1)