diff options
author | Heikki Linnakangas <heikki.linnakangas@iki.fi> | 2008-12-01 17:11:18 +0000 |
---|---|---|
committer | Heikki Linnakangas <heikki.linnakangas@iki.fi> | 2008-12-01 17:11:18 +0000 |
commit | 7fb27531e8f51448f061a007534db67e0467a23e (patch) | |
tree | 3cabb43bf05b1fa154559b0b498ef6f5a68642a2 /src | |
parent | ec543db77b6b72f24d0a637c4a4a419cf8311d0b (diff) | |
download | postgresql-7fb27531e8f51448f061a007534db67e0467a23e.tar.gz postgresql-7fb27531e8f51448f061a007534db67e0467a23e.zip |
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
Diffstat (limited to 'src')
-rw-r--r-- | src/backend/utils/adt/formatting.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/backend/utils/adt/formatting.c b/src/backend/utils/adt/formatting.c index 918701b8233..5496ca496fc 100644 --- a/src/backend/utils/adt/formatting.c +++ b/src/backend/utils/adt/formatting.c @@ -1,7 +1,7 @@ /* ----------------------------------------------------------------------- * formatting.c * - * $PostgreSQL: pgsql/src/backend/utils/adt/formatting.c,v 1.150 2008/11/10 17:36:53 heikki Exp $ + * $PostgreSQL: pgsql/src/backend/utils/adt/formatting.c,v 1.151 2008/12/01 17:11:18 heikki Exp $ * * * Portions Copyright (c) 1999-2008, PostgreSQL Global Development Group @@ -1678,8 +1678,9 @@ is_next_separator(FormatNode *n) */ n++; + /* end of format string is treated like a non-digit separator */ if (n->type == NODE_TYPE_END) - return FALSE; + return TRUE; if (n->type == NODE_TYPE_ACTION) { |