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
7a3e7b64
Commit
7a3e7b64
authored
Mar 27, 2003
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
to_char fixes, Karel Zak
parent
bf576cc0
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
182 additions
and
190 deletions
+182
-190
doc/src/sgml/func.sgml
doc/src/sgml/func.sgml
+18
-4
src/backend/utils/adt/formatting.c
src/backend/utils/adt/formatting.c
+116
-138
src/test/regress/expected/int8.out
src/test/regress/expected/int8.out
+12
-12
src/test/regress/expected/numeric.out
src/test/regress/expected/numeric.out
+36
-36
No files found.
doc/src/sgml/func.sgml
View file @
7a3e7b64
<!--
$Header: /cvsroot/pgsql/doc/src/sgml/func.sgml,v 1.14
8 2003/03/25 16:15:36 petere
Exp $
$Header: /cvsroot/pgsql/doc/src/sgml/func.sgml,v 1.14
9 2003/03/27 16:35:30 momjian
Exp $
PostgreSQL documentation
-->
...
...
@@ -4365,7 +4365,7 @@ substring('foobar' from 'o(.)b') <lineannotation>o</lineannotation>
</row>
<row>
<entry><literal>to_char(-0.1, '99.99')</literal></entry>
<entry><literal>' -.10'</literal></entry>
<entry><literal>'
-.10'</literal></entry>
</row>
<row>
<entry><literal>to_char(-0.1, 'FM9.99')</literal></entry>
...
...
@@ -4381,7 +4381,7 @@ substring('foobar' from 'o(.)b') <lineannotation>o</lineannotation>
</row>
<row>
<entry><literal>to_char(12, 'FM9990999.9')</literal></entry>
<entry><literal>'0012'</literal></entry>
<entry><literal>'0012
.
'</literal></entry>
</row>
<row>
<entry><literal>to_char(485, '999')</literal></entry>
...
...
@@ -4405,8 +4405,18 @@ substring('foobar' from 'o(.)b') <lineannotation>o</lineannotation>
</row>
<row>
<entry><literal>to_char(148.5, '999.999')</literal></entry>
<entry><literal>'
148.500'</literal></entry>
<entry><literal>'
148.500'</literal></entry>
</row>
<row>
<entry><literal>to_char(148.5, 'FM999.999')</literal></entry>
<entry><literal>'148.5'</literal></entry>
</row>
<row>
<row>
<entry><literal>to_char(148.5, 'FM999.990')</literal></entry>
<entry><literal>'148.500'</literal></entry>
</row>
<row>
<row>
<entry><literal>to_char(148.5, '999D999')</literal></entry>
<entry><literal>' 148,500'</literal></entry>
...
...
@@ -4425,6 +4435,10 @@ substring('foobar' from 'o(.)b') <lineannotation>o</lineannotation>
</row>
<row>
<entry><literal>to_char(485, '999MI')</literal></entry>
<entry><literal>'485 '</literal></entry>
</row>
<row>
<entry><literal>to_char(485, 'FM999MI')</literal></entry>
<entry><literal>'485'</literal></entry>
</row>
<row>
...
...
src/backend/utils/adt/formatting.c
View file @
7a3e7b64
This diff is collapsed.
Click to expand it.
src/test/regress/expected/int8.out
View file @
7a3e7b64
...
...
@@ -139,7 +139,7 @@ SELECT '' AS to_char_3, to_char( (q1 * -1), '9999999999999999PR'), to_char( (q2
| <123> | <4567890123456789.000>
| <4567890123456789> | <123.000>
| <4567890123456789> | <4567890123456789.000>
| <4567890123456789> | 4567890123456789.000
| <4567890123456789> | 4567890123456789.000
(5 rows)
SELECT '' AS to_char_4, to_char( (q1 * -1), '9999999999999999S'), to_char( (q2 * -1), 'S9999999999999999')
...
...
@@ -154,12 +154,12 @@ SELECT '' AS to_char_4, to_char( (q1 * -1), '9999999999999999S'), to_char( (q2 *
(5 rows)
SELECT '' AS to_char_5, to_char(q2, 'MI9999999999999999') FROM INT8_TBL;
to_char_5 | to_char
-----------+-------------------
-
|
456
|
4567890123456789
|
123
|
4567890123456789
to_char_5 | to_char
-----------+-------------------
| 456
| 4567890123456789
| 123
| 4567890123456789
| -4567890123456789
(5 rows)
...
...
@@ -256,11 +256,11 @@ SELECT '' AS to_char_14, to_char(q2, 'FM9999999999999999.999') FROM INT8_TBL;
SELECT '' AS to_char_15, to_char(q2, 'S 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 . 9 9 9') FROM INT8_TBL;
to_char_15 | to_char
------------+-------------------------------------------
|
+4 5 6 . 0 0 0
|
+
4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 . 0 0 0
|
+1 2 3 . 0 0 0
|
+
4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 . 0 0 0
|
-
4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 . 0 0 0
|
+4 5 6 . 0 0 0
|
+
4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 . 0 0 0
|
+1 2 3 . 0 0 0
|
+
4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 . 0 0 0
|
-
4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 . 0 0 0
(5 rows)
SELECT '' AS to_char_16, to_char(q2, '99999 "text" 9999 "9999" 999 "\\"text between quote marks\\"" 9999') FROM INT8_TBL;
...
...
src/test/regress/expected/numeric.out
View file @
7a3e7b64
...
...
@@ -732,15 +732,15 @@ SELECT '' AS to_char_3, to_char(val, '9999999999999999.999999999999999PR')
FROM num_data;
to_char_3 | to_char
-----------+------------------------------------
| .000000000000000
| .000000000000000
| .000000000000000
| .000000000000000
| <34338492.215397047000000>
| 4.310000000000000
| 7799461.411900000000000
| 16397.038491000000000
| 93901.577630260000000
| 4.310000000000000
| 7799461.411900000000000
| 16397.038491000000000
| 93901.577630260000000
| <83028485.000000000000000>
| 74881.000000000000000
| 74881.000000000000000
| <24926804.045047420000000>
(10 rows)
...
...
@@ -761,17 +761,17 @@ SELECT '' AS to_char_4, to_char(val, '9999999999999999.999999999999999S')
(10 rows)
SELECT '' AS to_char_5, to_char(val, 'MI9999999999999999.999999999999999') FROM num_data;
to_char_5 | to_char
-----------+-----------------------------------
-
|
.000000000000000
|
.000000000000000
to_char_5 | to_char
-----------+-----------------------------------
| .000000000000000
| .000000000000000
| - 34338492.215397047000000
|
4.310000000000000
|
7799461.411900000000000
|
16397.038491000000000
|
93901.577630260000000
| 4.310000000000000
| 7799461.411900000000000
| 16397.038491000000000
| 93901.577630260000000
| - 83028485.000000000000000
|
74881.000000000000000
| 74881.000000000000000
| - 24926804.045047420000000
(10 rows)
...
...
@@ -958,31 +958,31 @@ SELECT '' AS to_char_17, to_char(val, 'FM9999999999999999.99999999999999') FROM
SELECT '' AS to_char_18, to_char(val, 'S 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 . 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9') FROM num_data;
to_char_18 | to_char
------------+-----------------------------------------------------------------------
|
. +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
. +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
-3 4 3 3 8 4 9 2 . 2 1 5 3 9 7 0 4 7 0 0 0 0 0 0 0 0
|
+4 . 3 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
+7 7 9 9 4 6 1 . 4 1 1 9 0 0 0 0 0 0 0 0 0 0 0 0 0
|
+1 6 3 9 7 . 0 3 8 4 9 1 0 0 0 0 0 0 0 0 0 0 0
|
+9 3 9 0 1 . 5 7 7 6 3 0 2 6 0 0 0 0 0 0 0 0 0
|
-8 3 0 2 8 4 8 5 . 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
+7 4 8 8 1 . 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
-2 4 9 2 6 8 0 4 . 0 4 5 0 4 7 4 2 0 0 0 0 0 0 0 0 0
|
+. 0 0 0 0 0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1 .
|
-2 4 9 2 6 8 0 4 . 0 4 5 0 4 7 4 2
(10 rows)
SELECT '' AS to_char_20, to_char(val, '99999 "text" 9999 "9999" 999 "\\"text between quote marks\\"" 9999') FROM num_data;
...
...
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