Groups
Groups
Sign in
Groups
Groups
comp.databases.postgresql
Conversations
About
Send feedback
Help
Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss
Learn more
TO_CHAR Issue or Designed feature
6 views
Skip to first unread message
Thomas Morgan
unread,
Jan 29, 2024, 5:22:16 PM
1/29/24
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
When I issue following
SELECT to_char(now(), 'Hh24') Current_Hour;
I get:
current_hour
--------------
Hh24
(1 row)
Is this documented or it it a flaw. Should it be doing the format case insensitive?
Thanks,
Thomas
John-Paul Stewart
unread,
Jan 29, 2024, 7:06:50 PM
1/29/24
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
Although it is not explicitly stated, the format string must be case
sensitive. You can infer that from the following table:
https://www.postgresql.org/docs/15/functions-formatting.html#FUNCTIONS-FORMATTING-DATETIME-TABLE
Note the difference between "AM" and "am", or "MONTH" and "Month" and
"month". (To name just two examples.) Based on that, it should be
obvious that the pattern has to be interpreted in a case sensitive manner.
0 new messages