Table 9.31. to_char Examples
The following documentation comment has been logged on the website:
Page: https://www.postgresql.org/docs/18/functions-matching.html
Description:
This is not true:
```html
to_char(485, 'PL999') '+485'
```
add examples:
```psql
db=# SELECT quote_literal(to_char(timestamp '2026-04-15','RM'));
quote_literal
---------------
'IV '
(1 рядок)
db=# SELECT quote_literal(to_char(timestamp '2026-04-15','FMRM'));
quote_literal
---------------
'IV'
(1 рядок)
db=# SELECT quote_literal(to_char(timestamp '2026-12-31', 'rm'));
quote_literal
---------------
'xii '
(1 рядок)
```
On Monday, September 28, 2026, PG Doc comments form <noreply@postgresql.org>
wrote:
The following documentation comment has been logged on the website:
Page: https://www.postgresql.org/docs/18/functions-matching.html
Description:This is not true:
```html
to_char(485, 'PL999') '+485'
```
You are correct. As a practical matter there will always be a space after
the plus sign since the formatting code seems to consumes two places. This
may arguably be a bug, but at this point we should just document the
behavior we have.
David J.
On 28 Sep 2026, at 21:05, David G. Johnston <david.g.johnston@gmail.com> wrote:
This may arguably be a bug, but at this point we should just document the
behavior we have.
Agreed, pushed and backpatched all the way. The documentation has this output
down to 7.1 but I only tested down to 14.
--
Daniel Gustafsson