Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
efcff3da
Commit
efcff3da
authored
Jul 03, 2000
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
In the attache is new (correct) version. I add TZ (timezone) support
for to_char() too. Karel
parent
61768d8c
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
604 additions
and
490 deletions
+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
No files found.
doc/src/sgml/func.sgml
View file @
efcff3da
...
...
@@ -785,11 +785,11 @@
</row>
<row>
<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>
<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>
<entry>CC</entry>
...
...
@@ -811,6 +811,14 @@
<entry>rm</entry>
<entry>month in Roman Numerals (I-XII; I=JAN) - lower case</entry>
</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>
</tgroup>
</table>
...
...
@@ -871,9 +879,12 @@
<listitem>
<para>
<function>to_timestamp</function> and <function>to_date</function>
skip blank space if the <literal>FX</literal> option is
not used. <literal>FX</literal> must be specified as the first item
in the template.
skip multiple blank space in converted string if the <literal>FX</literal> option
is not used. <literal>FX</literal> must be specified as the first item
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>
</listitem>
...
...
src/backend/utils/adt/formatting.c
View file @
efcff3da
This diff is collapsed.
Click to expand it.
src/test/regress/expected/timestamp.out
View file @
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')
|
|
|
| 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
|
|
...
...
@@ -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 01 0
0
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 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
...
...
@@ -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 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 0
6
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
6
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
043 12 4 2450492
| 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
7
045 14 6 2450494
| 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
| 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
| 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,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
| 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 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 4 12 53 365 30 2 2450448
| 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 02 0
8
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 01 0
1
001 01 4 2450450
| 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
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 5
2
365 31 4 2450814
| 1,999 1999 999 99 9 20 4 12 5
2
365 31 6 2451544
| 2,000 2000 000 00 0 21 1 01 0
0
001 01 7 2451545
| 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
3
365 31 6 2451544
| 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,001 2001 001 01 1 21 1 01 01 001 01 2 2451911
(66 rows)
...
...
@@ -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
|
|
...
...
@@ -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 1
0
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 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
...
...
@@ -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 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
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
6
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
43 12 4 2450492
| 1,997 1997 997 97 7 20 1 2
7
44 13 5 2450493
| 1,997 1997 997 97 7 20 1 2
7
45 14 6 2450494
| 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
| 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
| 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,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
| 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 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 4 12 53 365 30 2 2450448
| 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 2
8
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 1
1
1 1 4 2450450
| 1,997 1997 997 97 7 20 1 2
9
59 28 6 2450508
| 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 5
2
365 31 4 2450814
| 1,999 1999 999 99 9 20 4 12 5
2
365 31 6 2451544
| 2,000 2000 000 00 0 21 1 1
0
1 1 7 2451545
| 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
3
365 31 6 2451544
| 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,001 2001 001 01 1 21 1 1 1 1 1 2 2451911
(66 rows)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment