Skip to content

Commit 7fb2753

Browse files
committed
Modify the new to_timestamp implementation so that end-of-format-string
is treated like a non-digit separator. This fixes the inconsistency in examples like: to_timestamp('2008-01-2', 'YYYY-MM-DD') -- didn't work and to_timestamp('2008-1-02', 'YYYY-MM-DD') -- did work
1 parent ec543db commit 7fb2753

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/backend/utils/adt/formatting.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* -----------------------------------------------------------------------
22
* formatting.c
33
*
4-
* $PostgreSQL: pgsql/src/backend/utils/adt/formatting.c,v 1.150 2008/11/10 17:36:53 heikki Exp $
4+
* $PostgreSQL: pgsql/src/backend/utils/adt/formatting.c,v 1.151 2008/12/01 17:11:18 heikki Exp $
55
*
66
*
77
* Portions Copyright (c) 1999-2008, PostgreSQL Global Development Group
@@ -1678,8 +1678,9 @@ is_next_separator(FormatNode *n)
16781678
*/
16791679
n++;
16801680

1681+
/* end of format string is treated like a non-digit separator */
16811682
if (n->type == NODE_TYPE_END)
1682-
return FALSE;
1683+
return TRUE;
16831684

16841685
if (n->type == NODE_TYPE_ACTION)
16851686
{

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy