Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Gpdb
提交
efcff3da
G
Gpdb
项目概览
Greenplum
/
Gpdb
通知
7
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
Gpdb
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
efcff3da
编写于
7月 03, 2000
作者:
B
Bruce Momjian
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
In the attache is new (correct) version. I add TZ (timezone) support
for to_char() too. Karel
上级
61768d8c
变更
3
展开全部
隐藏空白更改
内联
并排
Showing
3 changed file
with
604 addition
and
490 deletion
+604
-490
doc/src/sgml/func.sgml
doc/src/sgml/func.sgml
+16
-5
src/backend/utils/adt/formatting.c
src/backend/utils/adt/formatting.c
+556
-453
src/test/regress/expected/timestamp.out
src/test/regress/expected/timestamp.out
+32
-32
未找到文件。
doc/src/sgml/func.sgml
浏览文件 @
efcff3da
...
@@ -785,11 +785,11 @@
...
@@ -785,11 +785,11 @@
</row>
</row>
<row>
<row>
<entry>W</entry>
<entry>W</entry>
<entry>week of month</entry>
<entry>week of month
(1-5) where first week start on the first day of the month
</entry>
</row>
</row>
<row>
<row>
<entry>WW</entry>
<entry>WW</entry>
<entry>week number of year</entry>
<entry>week number of year
(1-53) where first week start on the first day of the year
</entry>
</row>
</row>
<row>
<row>
<entry>CC</entry>
<entry>CC</entry>
...
@@ -811,6 +811,14 @@
...
@@ -811,6 +811,14 @@
<entry>rm</entry>
<entry>rm</entry>
<entry>month in Roman Numerals (I-XII; I=JAN) - lower case</entry>
<entry>month in Roman Numerals (I-XII; I=JAN) - lower case</entry>
</row>
</row>
<row>
<entry>TZ</entry>
<entry>timezone string - upper case (not supported in the to_timestamp())</entry>
</row>
<row>
<entry>tz</entry>
<entry>timezone string - lower case (not supported in the to_timestamp())</entry>
</row>
</tbody>
</tbody>
</tgroup>
</tgroup>
</table>
</table>
...
@@ -871,9 +879,12 @@
...
@@ -871,9 +879,12 @@
<listitem>
<listitem>
<para>
<para>
<function>to_timestamp</function> and <function>to_date</function>
<function>to_timestamp</function> and <function>to_date</function>
skip blank space if the <literal>FX</literal> option is
skip multiple blank space in converted string if the <literal>FX</literal> option
not used. <literal>FX</literal> must be specified as the first item
is not used. <literal>FX</literal> must be specified as the first item
in the template.
in the template; for example
<literal>to_timestamp('2000 JUN','YYYY MON')</literal> is right, but
<literal>to_timestamp('2000 JUN','FXYYYY MON')</literal> returns error,
because to_timestamp() expects one blank space only.
</para>
</para>
</listitem>
</listitem>
...
...
src/backend/utils/adt/formatting.c
浏览文件 @
efcff3da
此差异已折叠。
点击以展开。
src/test/regress/expected/timestamp.out
浏览文件 @
efcff3da
...
@@ -1023,7 +1023,7 @@ SELECT '' AS to_char_3, to_char(d1, 'Y,YYY YYYY YYY YY Y CC Q MM WW DDD DD D J')
...
@@ -1023,7 +1023,7 @@ SELECT '' AS to_char_3, to_char(d1, 'Y,YYY YYYY YYY YY Y CC Q MM WW DDD DD D J')
|
|
|
|
|
|
| 1,970 1970 970 70 0 20 1 01 0
0
001 01 5 2440588
| 1,970 1970 970 70 0 20 1 01 0
1
001 01 5 2440588
| 1,997 1997 997 97 7 20 1 02 06 041 10 2 2450490
| 1,997 1997 997 97 7 20 1 02 06 041 10 2 2450490
|
|
|
|
...
@@ -1032,8 +1032,8 @@ SELECT '' AS to_char_3, to_char(d1, 'Y,YYY YYYY YYY YY Y CC Q MM WW DDD DD D J')
...
@@ -1032,8 +1032,8 @@ SELECT '' AS to_char_3, to_char(d1, 'Y,YYY YYYY YYY YY Y CC Q MM WW DDD DD D J')
| 1,997 1997 997 97 7 20 1 02 06 041 10 2 2450490
| 1,997 1997 997 97 7 20 1 02 06 041 10 2 2450490
| 1,997 1997 997 97 7 20 1 02 06 041 10 2 2450490
| 1,997 1997 997 97 7 20 1 02 06 041 10 2 2450490
| 1,997 1997 997 97 7 20 1 02 06 041 10 2 2450490
| 1,997 1997 997 97 7 20 1 02 06 041 10 2 2450490
| 1,997 1997 997 97 7 20 1 01 0
0
002 02 5 2450451
| 1,997 1997 997 97 7 20 1 01 0
1
002 02 5 2450451
| 1,997 1997 997 97 7 20 1 01 0
0
002 02 5 2450451
| 1,997 1997 997 97 7 20 1 01 0
1
002 02 5 2450451
| 1,997 1997 997 97 7 20 1 02 06 041 10 2 2450490
| 1,997 1997 997 97 7 20 1 02 06 041 10 2 2450490
| 1,997 1997 997 97 7 20 1 02 06 041 10 2 2450490
| 1,997 1997 997 97 7 20 1 02 06 041 10 2 2450490
| 1,997 1997 997 97 7 20 1 02 06 041 10 2 2450490
| 1,997 1997 997 97 7 20 1 02 06 041 10 2 2450490
...
@@ -1058,32 +1058,32 @@ SELECT '' AS to_char_3, to_char(d1, 'Y,YYY YYYY YYY YY Y CC Q MM WW DDD DD D J')
...
@@ -1058,32 +1058,32 @@ SELECT '' AS to_char_3, to_char(d1, 'Y,YYY YYYY YYY YY Y CC Q MM WW DDD DD D J')
| 1,997 1997 997 97 7 20 2 06 23 161 10 3 2450610
| 1,997 1997 997 97 7 20 2 06 23 161 10 3 2450610
| 1,997 1997 997 97 7 20 1 02 06 041 10 2 2450490
| 1,997 1997 997 97 7 20 1 02 06 041 10 2 2450490
| 1,997 1997 997 97 7 20 1 02 06 042 11 3 2450491
| 1,997 1997 997 97 7 20 1 02 06 042 11 3 2450491
| 1,997 1997 997 97 7 20 1 02 0
6
043 12 4 2450492
| 1,997 1997 997 97 7 20 1 02 0
7
043 12 4 2450492
| 1,997 1997 997 97 7 20 1 02 0
6
044 13 5 2450493
| 1,997 1997 997 97 7 20 1 02 0
7
044 13 5 2450493
| 1,997 1997 997 97 7 20 1 02 0
6
045 14 6 2450494
| 1,997 1997 997 97 7 20 1 02 0
7
045 14 6 2450494
| 1,997 1997 997 97 7 20 1 02 0
6
046 15 7 2450495
| 1,997 1997 997 97 7 20 1 02 0
7
046 15 7 2450495
| 1,997 1997 997 97 7 20 1 02 07 047 16 1 2450496
| 1,997 1997 997 97 7 20 1 02 07 047 16 1 2450496
| 0,097 0097 097 97 7 01 1 02 07 047 16 3 1686042
| 0,097 0097 097 97 7 01 1 02 07 047 16 3 1686042
| 0,097 0097 097 97 7 01 1 02 0
6
047 16 7 1756536
| 0,097 0097 097 97 7 01 1 02 0
7
047 16 7 1756536
| 0,597 0597 597 97 7 06 1 02 07 047 16 5 1939157
| 0,597 0597 597 97 7 06 1 02 07 047 16 5 1939157
| 1,097 1097 097 97 7 11 1 02 07 047 16 3 2121778
| 1,097 1097 097 97 7 11 1 02 07 047 16 3 2121778
| 1,697 1697 697 97 7 17 1 02 0
6
047 16 7 2340924
| 1,697 1697 697 97 7 17 1 02 0
7
047 16 7 2340924
| 1,797 1797 797 97 7 18 1 02 07 047 16 5 2377448
| 1,797 1797 797 97 7 18 1 02 07 047 16 5 2377448
| 1,897 1897 897 97 7 19 1 02 07 047 16 3 2413972
| 1,897 1897 897 97 7 19 1 02 07 047 16 3 2413972
| 1,997 1997 997 97 7 20 1 02 07 047 16 1 2450496
| 1,997 1997 997 97 7 20 1 02 07 047 16 1 2450496
| 2,097 2097 097 97 7 21 1 02 0
6
047 16 7 2487021
| 2,097 2097 097 97 7 21 1 02 0
7
047 16 7 2487021
| 1,996 1996 996 96 6 20 1 02 09 059 28 4 2450142
| 1,996 1996 996 96 6 20 1 02 09 059 28 4 2450142
| 1,996 1996 996 96 6 20 1 02 09 060 29 5 2450143
| 1,996 1996 996 96 6 20 1 02 09 060 29 5 2450143
| 1,996 1996 996 96 6 20 1 03 09 061 01 6 2450144
| 1,996 1996 996 96 6 20 1 03 09 061 01 6 2450144
| 1,996 1996 996 96 6 20 4 12 53 365 30 2 2450448
| 1,996 1996 996 96 6 20 4 12 53 365 30 2 2450448
| 1,996 1996 996 96 6 20 4 12 53 366 31 3 2450449
| 1,996 1996 996 96 6 20 4 12 53 366 31 3 2450449
| 1,997 1997 997 97 7 20 1 01 0
0
001 01 4 2450450
| 1,997 1997 997 97 7 20 1 01 0
1
001 01 4 2450450
| 1,997 1997 997 97 7 20 1 02 0
8
059 28 6 2450508
| 1,997 1997 997 97 7 20 1 02 0
9
059 28 6 2450508
| 1,997 1997 997 97 7 20 1 03 0
8
060 01 7 2450509
| 1,997 1997 997 97 7 20 1 03 0
9
060 01 7 2450509
| 1,997 1997 997 97 7 20 4 12 52 364 30 3 2450813
| 1,997 1997 997 97 7 20 4 12 52 364 30 3 2450813
| 1,997 1997 997 97 7 20 4 12 5
2
365 31 4 2450814
| 1,997 1997 997 97 7 20 4 12 5
3
365 31 4 2450814
| 1,999 1999 999 99 9 20 4 12 5
2
365 31 6 2451544
| 1,999 1999 999 99 9 20 4 12 5
3
365 31 6 2451544
| 2,000 2000 000 00 0 21 1 01 0
0
001 01 7 2451545
| 2,000 2000 000 00 0 21 1 01 0
1
001 01 7 2451545
| 2,000 2000 000 00 0 21 4 12 53 366 31 1 2451910
| 2,000 2000 000 00 0 21 4 12 53 366 31 1 2451910
| 2,001 2001 001 01 1 21 1 01 01 001 01 2 2451911
| 2,001 2001 001 01 1 21 1 01 01 001 01 2 2451911
(66 rows)
(66 rows)
...
@@ -1096,7 +1096,7 @@ SELECT '' AS to_char_4, to_char(d1, 'FMY,YYY FMYYYY FMYYY FMYY FMY FMCC FMQ FMMM
...
@@ -1096,7 +1096,7 @@ SELECT '' AS to_char_4, to_char(d1, 'FMY,YYY FMYYYY FMYYY FMYY FMY FMCC FMQ FMMM
|
|
|
|
|
|
| 1,970 1970 970 70 0 20 1 1
0
1 1 5 2440588
| 1,970 1970 970 70 0 20 1 1
1
1 1 5 2440588
| 1,997 1997 997 97 7 20 1 2 6 41 10 2 2450490
| 1,997 1997 997 97 7 20 1 2 6 41 10 2 2450490
|
|
|
|
...
@@ -1105,8 +1105,8 @@ SELECT '' AS to_char_4, to_char(d1, 'FMY,YYY FMYYYY FMYYY FMYY FMY FMCC FMQ FMMM
...
@@ -1105,8 +1105,8 @@ SELECT '' AS to_char_4, to_char(d1, 'FMY,YYY FMYYYY FMYYY FMYY FMY FMCC FMQ FMMM
| 1,997 1997 997 97 7 20 1 2 6 41 10 2 2450490
| 1,997 1997 997 97 7 20 1 2 6 41 10 2 2450490
| 1,997 1997 997 97 7 20 1 2 6 41 10 2 2450490
| 1,997 1997 997 97 7 20 1 2 6 41 10 2 2450490
| 1,997 1997 997 97 7 20 1 2 6 41 10 2 2450490
| 1,997 1997 997 97 7 20 1 2 6 41 10 2 2450490
| 1,997 1997 997 97 7 20 1 1
0
2 2 5 2450451
| 1,997 1997 997 97 7 20 1 1
1
2 2 5 2450451
| 1,997 1997 997 97 7 20 1 1
0
2 2 5 2450451
| 1,997 1997 997 97 7 20 1 1
1
2 2 5 2450451
| 1,997 1997 997 97 7 20 1 2 6 41 10 2 2450490
| 1,997 1997 997 97 7 20 1 2 6 41 10 2 2450490
| 1,997 1997 997 97 7 20 1 2 6 41 10 2 2450490
| 1,997 1997 997 97 7 20 1 2 6 41 10 2 2450490
| 1,997 1997 997 97 7 20 1 2 6 41 10 2 2450490
| 1,997 1997 997 97 7 20 1 2 6 41 10 2 2450490
...
@@ -1131,32 +1131,32 @@ SELECT '' AS to_char_4, to_char(d1, 'FMY,YYY FMYYYY FMYYY FMYY FMY FMCC FMQ FMMM
...
@@ -1131,32 +1131,32 @@ SELECT '' AS to_char_4, to_char(d1, 'FMY,YYY FMYYYY FMYYY FMYY FMY FMCC FMQ FMMM
| 1,997 1997 997 97 7 20 2 6 23 161 10 3 2450610
| 1,997 1997 997 97 7 20 2 6 23 161 10 3 2450610
| 1,997 1997 997 97 7 20 1 2 6 41 10 2 2450490
| 1,997 1997 997 97 7 20 1 2 6 41 10 2 2450490
| 1,997 1997 997 97 7 20 1 2 6 42 11 3 2450491
| 1,997 1997 997 97 7 20 1 2 6 42 11 3 2450491
| 1,997 1997 997 97 7 20 1 2
6
43 12 4 2450492
| 1,997 1997 997 97 7 20 1 2
7
43 12 4 2450492
| 1,997 1997 997 97 7 20 1 2
6
44 13 5 2450493
| 1,997 1997 997 97 7 20 1 2
7
44 13 5 2450493
| 1,997 1997 997 97 7 20 1 2
6
45 14 6 2450494
| 1,997 1997 997 97 7 20 1 2
7
45 14 6 2450494
| 1,997 1997 997 97 7 20 1 2
6
46 15 7 2450495
| 1,997 1997 997 97 7 20 1 2
7
46 15 7 2450495
| 1,997 1997 997 97 7 20 1 2 7 47 16 1 2450496
| 1,997 1997 997 97 7 20 1 2 7 47 16 1 2450496
| 0,097 97 097 97 7 1 1 2 7 47 16 3 1686042
| 0,097 97 097 97 7 1 1 2 7 47 16 3 1686042
| 0,097 97 097 97 7 1 1 2
6
47 16 7 1756536
| 0,097 97 097 97 7 1 1 2
7
47 16 7 1756536
| 0,597 597 597 97 7 6 1 2 7 47 16 5 1939157
| 0,597 597 597 97 7 6 1 2 7 47 16 5 1939157
| 1,097 1097 097 97 7 11 1 2 7 47 16 3 2121778
| 1,097 1097 097 97 7 11 1 2 7 47 16 3 2121778
| 1,697 1697 697 97 7 17 1 2
6
47 16 7 2340924
| 1,697 1697 697 97 7 17 1 2
7
47 16 7 2340924
| 1,797 1797 797 97 7 18 1 2 7 47 16 5 2377448
| 1,797 1797 797 97 7 18 1 2 7 47 16 5 2377448
| 1,897 1897 897 97 7 19 1 2 7 47 16 3 2413972
| 1,897 1897 897 97 7 19 1 2 7 47 16 3 2413972
| 1,997 1997 997 97 7 20 1 2 7 47 16 1 2450496
| 1,997 1997 997 97 7 20 1 2 7 47 16 1 2450496
| 2,097 2097 097 97 7 21 1 2
6
47 16 7 2487021
| 2,097 2097 097 97 7 21 1 2
7
47 16 7 2487021
| 1,996 1996 996 96 6 20 1 2 9 59 28 4 2450142
| 1,996 1996 996 96 6 20 1 2 9 59 28 4 2450142
| 1,996 1996 996 96 6 20 1 2 9 60 29 5 2450143
| 1,996 1996 996 96 6 20 1 2 9 60 29 5 2450143
| 1,996 1996 996 96 6 20 1 3 9 61 1 6 2450144
| 1,996 1996 996 96 6 20 1 3 9 61 1 6 2450144
| 1,996 1996 996 96 6 20 4 12 53 365 30 2 2450448
| 1,996 1996 996 96 6 20 4 12 53 365 30 2 2450448
| 1,996 1996 996 96 6 20 4 12 53 366 31 3 2450449
| 1,996 1996 996 96 6 20 4 12 53 366 31 3 2450449
| 1,997 1997 997 97 7 20 1 1
0
1 1 4 2450450
| 1,997 1997 997 97 7 20 1 1
1
1 1 4 2450450
| 1,997 1997 997 97 7 20 1 2
8
59 28 6 2450508
| 1,997 1997 997 97 7 20 1 2
9
59 28 6 2450508
| 1,997 1997 997 97 7 20 1 3
8
60 1 7 2450509
| 1,997 1997 997 97 7 20 1 3
9
60 1 7 2450509
| 1,997 1997 997 97 7 20 4 12 52 364 30 3 2450813
| 1,997 1997 997 97 7 20 4 12 52 364 30 3 2450813
| 1,997 1997 997 97 7 20 4 12 5
2
365 31 4 2450814
| 1,997 1997 997 97 7 20 4 12 5
3
365 31 4 2450814
| 1,999 1999 999 99 9 20 4 12 5
2
365 31 6 2451544
| 1,999 1999 999 99 9 20 4 12 5
3
365 31 6 2451544
| 2,000 2000 000 00 0 21 1 1
0
1 1 7 2451545
| 2,000 2000 000 00 0 21 1 1
1
1 1 7 2451545
| 2,000 2000 000 00 0 21 4 12 53 366 31 1 2451910
| 2,000 2000 000 00 0 21 4 12 53 366 31 1 2451910
| 2,001 2001 001 01 1 21 1 1 1 1 1 2 2451911
| 2,001 2001 001 01 1 21 1 1 1 1 1 2 2451911
(66 rows)
(66 rows)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录