On 2023-11-24 18:29 +0100, Bruce Momjian wrote: > On Thu, Nov 23, 2023 at 09:29:39AM +0100, Laurenz Albe wrote: > > On Wed, 2023-11-22 at 11:58 -0500, Bruce Momjian wrote: > > > Okay, I moved it into the "Note" section that talked about ISO 8601 > > > output with "T", in the attached patch. > > > > Fine by me, except that I would rather have "returns" or "produces" > > instead of the questionable verb "outputs". > > The majority of people seem to want it in table 9.31, so I have moved it > there.
Fine by me. > It does almost double the width of the displayed table though. > You can see the new output here: > > > https://momjian.us/tmp/pgsql/functions-formatting.html#FUNCTIONS-FORMATTING-EXAMPLES-TABLE > > Patch attached. Two issues that I fixed in the attached patch: * the time zone was missing from the result output * it's called "extended format" not "T format" (the "T" is mandatory anyway) -- Erik
diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml index 20da3ed033..8a83ac0529 100644 --- a/doc/src/sgml/func.sgml +++ b/doc/src/sgml/func.sgml @@ -8748,6 +8748,12 @@ SELECT regexp_match('abc01234xyz', '(?:(.*?)(\d+)(.*)){1,1}'); <entry><literal>to_char(current_timestamp, 'FMDay, FMDD HH12:MI:SS')</literal></entry> <entry><literal>'Tuesday, 6 05:39:18'</literal></entry> </row> + <row> + <entry><literal>to_char(current_timestamp AT TIME ZONE + 'UTC', 'YYYY-MM-DD"T"HH24:MI:SSZ')</literal></entry> + <entry><literal>'2022-12-06T05:39:18Z'</literal>, + <acronym>ISO</acronym> 8601 extended format</entry> + </row> <row> <entry><literal>to_char(-0.1, '99.99')</literal></entry> <entry><literal>' -.10'</literal></entry>