| From: | "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com> |
|---|---|
| To: | "y(dot)saburov(at)gmail(dot)com" <y(dot)saburov(at)gmail(dot)com>, "pgsql-docs(at)lists(dot)postgresql(dot)org" <pgsql-docs(at)lists(dot)postgresql(dot)org> |
| Subject: | Re: 9.4.1. format |
| Date: | 2026-09-19 13:55:27 |
| Message-ID: | CAKFQuwZYpKRfpunJJV2t_nmTavU+TANoSaKsa1c36hthPYb5tA@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-docs |
On Saturday, September 19, 2026, PG Doc comments form <
noreply(at)postgresql(dot)org> wrote:
> The following documentation comment has been logged on the website:
>
> Page: https://www.postgresql.org/docs/18/functions-string.html
> Description:
>
> >> Here are some examples of the basic format conversions:
>
> ```html
> SELECT format('INSERT INTO %I VALUES(%L)', 'locations', 'C:\Program
> Files');
> Result: INSERT INTO locations VALUES('C:\Program Files')
> ```
>
> ```sql
> db=# SELECT format('INSERT INTO %I VALUES(%L)', 'locations', 'C:\Program
> Files');
>
> format
> ----------------------------------------------------
> INSERT INTO locations VALUES(E'C:\\Program Files')
> ```
>
Indeed, the example doesn’t reflect the actual output since the presence of
a backslash prompts format to produce syntax for an escape string.
I don’t see a point for explaining when it may choose to write an escape
string but the examples should match reality. I’d back-patch this to
supported versions on that basis.
David J.
| From | Date | Subject | |
|---|---|---|---|
| Next Message | PG Doc comments form | 2026-09-19 14:49:55 | E.6.3.2.1. Constraints |
| Previous Message | PG Doc comments form | 2026-09-19 05:52:22 | 9.4.1. format |