Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit418cf04

Browse files
committed
Update from Andreas Kardos.
1 parent0c90431 commit418cf04

File tree

1 file changed

+176
-0
lines changed

1 file changed

+176
-0
lines changed

‎src/test/regress/expected/int8-exp-three-digits.out

Lines changed: 176 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,3 +117,179 @@ SELECT '' AS five, q1 * 2 AS "twice int4" FROM INT8_TBL;
117117
| 9135780246913578
118118
(5 rows)
119119

120+
-- TO_CHAR()
121+
--
122+
SELECT '' AS to_char_1, to_char(q1, '9G999G999G999G999G999'), to_char(q2, '9,999,999,999,999,999')
123+
FROM INT8_TBL;
124+
to_char_1 | to_char | to_char
125+
-----------+------------------------+------------------------
126+
| 123 | 456
127+
| 123 | 4,567,890,123,456,789
128+
| 4,567,890,123,456,789 | 123
129+
| 4,567,890,123,456,789 | 4,567,890,123,456,789
130+
| 4,567,890,123,456,789 | -4,567,890,123,456,789
131+
(5 rows)
132+
133+
SELECT '' AS to_char_2, to_char(q1, '9G999G999G999G999G999D999G999'), to_char(q2, '9,999,999,999,999,999.999,999')
134+
FROM INT8_TBL;
135+
to_char_2 | to_char | to_char
136+
-----------+--------------------------------+--------------------------------
137+
| 123.000,000 | 456.000,000
138+
| 123.000,000 | 4,567,890,123,456,789.000,000
139+
| 4,567,890,123,456,789.000,000 | 123.000,000
140+
| 4,567,890,123,456,789.000,000 | 4,567,890,123,456,789.000,000
141+
| 4,567,890,123,456,789.000,000 | -4,567,890,123,456,789.000,000
142+
(5 rows)
143+
144+
SELECT '' AS to_char_3, to_char( (q1 * -1), '9999999999999999PR'), to_char( (q2 * -1), '9999999999999999.999PR')
145+
FROM INT8_TBL;
146+
to_char_3 | to_char | to_char
147+
-----------+--------------------+------------------------
148+
| <123> | <456.000>
149+
| <123> | <4567890123456789.000>
150+
| <4567890123456789> | <123.000>
151+
| <4567890123456789> | <4567890123456789.000>
152+
| <4567890123456789> | 4567890123456789.000
153+
(5 rows)
154+
155+
SELECT '' AS to_char_4, to_char( (q1 * -1), '9999999999999999S'), to_char( (q2 * -1), 'S9999999999999999')
156+
FROM INT8_TBL;
157+
to_char_4 | to_char | to_char
158+
-----------+-------------------+-------------------
159+
| 123- | -456
160+
| 123- | -4567890123456789
161+
| 4567890123456789- | -123
162+
| 4567890123456789- | -4567890123456789
163+
| 4567890123456789- | +4567890123456789
164+
(5 rows)
165+
166+
SELECT '' AS to_char_5, to_char(q2, 'MI9999999999999999') FROM INT8_TBL;
167+
to_char_5 | to_char
168+
-----------+--------------------
169+
| 456
170+
| 4567890123456789
171+
| 123
172+
| 4567890123456789
173+
| -4567890123456789
174+
(5 rows)
175+
176+
SELECT '' AS to_char_6, to_char(q2, 'FMS9999999999999999') FROM INT8_TBL;
177+
to_char_6 | to_char
178+
-----------+-------------------
179+
| +456
180+
| +4567890123456789
181+
| +123
182+
| +4567890123456789
183+
| -4567890123456789
184+
(5 rows)
185+
186+
SELECT '' AS to_char_7, to_char(q2, 'FM9999999999999999THPR') FROM INT8_TBL;
187+
to_char_7 | to_char
188+
-----------+--------------------
189+
| 456TH
190+
| 4567890123456789TH
191+
| 123RD
192+
| 4567890123456789TH
193+
| <4567890123456789>
194+
(5 rows)
195+
196+
SELECT '' AS to_char_8, to_char(q2, 'SG9999999999999999th') FROM INT8_TBL;
197+
to_char_8 | to_char
198+
-----------+---------------------
199+
| + 456th
200+
| +4567890123456789th
201+
| + 123rd
202+
| +4567890123456789th
203+
| -4567890123456789
204+
(5 rows)
205+
206+
SELECT '' AS to_char_9, to_char(q2, '0999999999999999') FROM INT8_TBL;
207+
to_char_9 | to_char
208+
-----------+-------------------
209+
| 0000000000000456
210+
| 4567890123456789
211+
| 0000000000000123
212+
| 4567890123456789
213+
| -4567890123456789
214+
(5 rows)
215+
216+
SELECT '' AS to_char_10, to_char(q2, 'S0999999999999999') FROM INT8_TBL;
217+
to_char_10 | to_char
218+
------------+-------------------
219+
| +0000000000000456
220+
| +4567890123456789
221+
| +0000000000000123
222+
| +4567890123456789
223+
| -4567890123456789
224+
(5 rows)
225+
226+
SELECT '' AS to_char_11, to_char(q2, 'FM0999999999999999') FROM INT8_TBL;
227+
to_char_11 | to_char
228+
------------+-------------------
229+
| 0000000000000456
230+
| 4567890123456789
231+
| 0000000000000123
232+
| 4567890123456789
233+
| -4567890123456789
234+
(5 rows)
235+
236+
SELECT '' AS to_char_12, to_char(q2, 'FM9999999999999999.000') FROM INT8_TBL;
237+
to_char_12 | to_char
238+
------------+-----------------------
239+
| 456.000
240+
| 4567890123456789.000
241+
| 123.000
242+
| 4567890123456789.000
243+
| -4567890123456789.000
244+
(5 rows)
245+
246+
SELECT '' AS to_char_13, to_char(q2, 'L9999999999999999.000') FROM INT8_TBL;
247+
to_char_13 | to_char
248+
------------+------------------------
249+
| 456.000
250+
| 4567890123456789.000
251+
| 123.000
252+
| 4567890123456789.000
253+
| -4567890123456789.000
254+
(5 rows)
255+
256+
SELECT '' AS to_char_14, to_char(q2, 'FM9999999999999999.999') FROM INT8_TBL;
257+
to_char_14 | to_char
258+
------------+-------------------
259+
| 456
260+
| 4567890123456789
261+
| 123
262+
| 4567890123456789
263+
| -4567890123456789
264+
(5 rows)
265+
266+
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;
267+
to_char_15 | to_char
268+
------------+-------------------------------------------
269+
| +4 5 6 . 0 0 0
270+
| + 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 . 0 0 0
271+
| +1 2 3 . 0 0 0
272+
| + 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 . 0 0 0
273+
| - 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 . 0 0 0
274+
(5 rows)
275+
276+
SELECT '' AS to_char_16, to_char(q2, '99999 text 9999 "9999" 999 "\\"text between quote marks\\"" 9999') FROM INT8_TBL;
277+
to_char_16 | to_char
278+
------------+-----------------------------------------------------------
279+
| text 9999 "text between quote marks" 456
280+
| 45678 text 9012 9999 345 "text between quote marks" 6789
281+
| text 9999 "text between quote marks" 123
282+
| 45678 text 9012 9999 345 "text between quote marks" 6789
283+
| -45678 text 9012 9999 345 "text between quote marks" 6789
284+
(5 rows)
285+
286+
SELECT '' AS to_char_17, to_char(q2, '999999SG9999999999') FROM INT8_TBL;
287+
to_char_17 | to_char
288+
------------+-------------------
289+
| + 456
290+
| 456789+0123456789
291+
| + 123
292+
| 456789+0123456789
293+
| 456789-0123456789
294+
(5 rows)
295+

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp