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
28fb1c19
Commit
28fb1c19
authored
Apr 07, 2000
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update create_rule manual page.
parent
dce53f0d
Changes
9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
500 additions
and
134 deletions
+500
-134
doc/src/sgml/func.sgml
doc/src/sgml/func.sgml
+21
-1
doc/src/sgml/ref/create_rule.sgml
doc/src/sgml/ref/create_rule.sgml
+19
-16
src/backend/utils/adt/formatting.c
src/backend/utils/adt/formatting.c
+360
-93
src/test/regress/expected/int8.out
src/test/regress/expected/int8.out
+1
-1
src/test/regress/expected/numeric.out
src/test/regress/expected/numeric.out
+10
-10
src/test/regress/expected/timestamp.out
src/test/regress/expected/timestamp.out
+80
-7
src/test/regress/sql/int8.sql
src/test/regress/sql/int8.sql
+1
-1
src/test/regress/sql/numeric.sql
src/test/regress/sql/numeric.sql
+5
-5
src/test/regress/sql/timestamp.sql
src/test/regress/sql/timestamp.sql
+3
-0
No files found.
doc/src/sgml/func.sgml
View file @
28fb1c19
...
@@ -688,6 +688,14 @@
...
@@ -688,6 +688,14 @@
<entry>SSSS</entry>
<entry>SSSS</entry>
<entry>seconds past midnight (0-86399)</entry>
<entry>seconds past midnight (0-86399)</entry>
</row>
</row>
<row>
<entry>AM or A.M. or PM or P.M.</entry>
<entry>meridian indicator (upper case)</entry>
</row>
<row>
<entry>am or a.m. or pm or p.m.</entry>
<entry>meridian indicator (lower case)</entry>
</row>
<row>
<row>
<entry>Y,YYY</entry>
<entry>Y,YYY</entry>
<entry>year (4 and more digits) with comma</entry>
<entry>year (4 and more digits) with comma</entry>
...
@@ -708,6 +716,14 @@
...
@@ -708,6 +716,14 @@
<entry>Y</entry>
<entry>Y</entry>
<entry>last digit of year</entry>
<entry>last digit of year</entry>
</row>
</row>
<row>
<entry>BC or B.C. or AD or A.D.</entry>
<entry>year indicator (upper case)</entry>
</row>
<row>
<entry>bc or b.c. or ad or a.d.</entry>
<entry>year indicator (lower case)</entry>
</row>
<row>
<row>
<entry>MONTH</entry>
<entry>MONTH</entry>
<entry>full upper case month name (9 chars)</entry>
<entry>full upper case month name (9 chars)</entry>
...
@@ -794,7 +810,11 @@
...
@@ -794,7 +810,11 @@
</row>
</row>
<row>
<row>
<entry>RM</entry>
<entry>RM</entry>
<entry>month in Roman Numerals (I-XII; I=JAN)</entry>
<entry>month in Roman Numerals (I-XII; I=JAN) - upper case</entry>
</row>
<row>
<entry>rn</entry>
<entry>month in Roman Numerals (I-XII; I=JAN) - lower case</entry>
</row>
</row>
</tbody>
</tbody>
</tgroup>
</tgroup>
...
...
doc/src/sgml/ref/create_rule.sgml
View file @
28fb1c19
<!--
<!--
$Header: /cvsroot/pgsql/doc/src/sgml/ref/create_rule.sgml,v 1.1
3 2000/04/07 17:37:24
momjian Exp $
$Header: /cvsroot/pgsql/doc/src/sgml/ref/create_rule.sgml,v 1.1
4 2000/04/07 19:17:30
momjian Exp $
Postgres documentation
Postgres documentation
-->
-->
...
@@ -126,16 +126,17 @@ CREATE
...
@@ -126,16 +126,17 @@ CREATE
<para>
<para>
The <productname>Postgres</productname>
The <productname>Postgres</productname>
<firstterm>rule system</firstterm> allows one to define an
<firstterm>rule system</firstterm> allows one to define an
alternate action to be performed on
updates, insert
s, or deletions
alternate action to be performed on
inserts, update
s, or deletions
from database tables or classes. Currently, rules are used to
from database tables or classes. Currently, rules are used to
implement table views.
implement table views.
</para>
</para>
<para>
<para>
The semantics of a rule is that at the time an individual instance is
The semantics of a rule is that at the time an individual instance is
accessed, updated, inserted or deleted, there is a current instance (for
accessed, inserted, updated, or deleted, there is a current instance (for
retrieves, updates and deletes) and a new instance (for updates and
selects, updates and deletes) and a new instance (for inserts and
appends). If the <replaceable class="parameter">event</replaceable>
updates).
If the <replaceable class="parameter">event</replaceable>
specified in the ON clause and the
specified in the ON clause and the
<replaceable class="parameter">condition</replaceable> specified in the
<replaceable class="parameter">condition</replaceable> specified in the
WHERE clause are true for the current instance, the
WHERE clause are true for the current instance, the
...
@@ -162,8 +163,8 @@ CREATE
...
@@ -162,8 +163,8 @@ CREATE
<para>
<para>
A caution about SQL rules is in order. If the same class name
A caution about SQL rules is in order. If the same class name
or instance variable appears in the
or instance variable appears in the
<replaceable class="parameter">event</replaceable>,
the
<replaceable class="parameter">event</replaceable>,
<replaceable class="parameter">condition</replaceable> and
the
<replaceable class="parameter">condition</replaceable> and
<replaceable class="parameter">action</replaceable> parts of a rule,
<replaceable class="parameter">action</replaceable> parts of a rule,
they are all considered different tuple variables. More accurately,
they are all considered different tuple variables. More accurately,
<literal>new</literal> and <literal>current</literal> are the only tuple
<literal>new</literal> and <literal>current</literal> are the only tuple
...
@@ -172,13 +173,13 @@ CREATE
...
@@ -172,13 +173,13 @@ CREATE
<programlisting>
<programlisting>
ON UPDATE TO emp.salary WHERE emp.name = "Joe"
ON UPDATE TO emp.salary WHERE emp.name = "Joe"
DO
DO
UPDATE emp
( ... )
WHERE ...
UPDATE emp
SET ...
WHERE ...
</programlisting>
</programlisting>
<programlisting>
<programlisting>
ON UPDATE TO emp-1.salary WHERE emp-2.name = "Joe"
ON UPDATE TO emp-1.salary WHERE emp-2.name = "Joe"
DO
DO
UPDATE emp-3
( ... )
WHERE ...
UPDATE emp-3
SET ...
WHERE ...
</programlisting>
</programlisting>
Each rule can have the optional tag INSTEAD.
Each rule can have the optional tag INSTEAD.
...
@@ -194,11 +195,12 @@ ON UPDATE TO emp-1.salary WHERE emp-2.name = "Joe"
...
@@ -194,11 +195,12 @@ ON UPDATE TO emp-1.salary WHERE emp-2.name = "Joe"
<literal>NOTHING</literal>.
<literal>NOTHING</literal>.
</para>
</para>
<para>
<para>
It is very important to note t
hat the rewrite rule system
It is very important to note t
o avoid circular rules.
will neither detect nor process circular rules.
For example, though each
For example, though each
of the following two rule definitions are accepted by
of the following two rule definitions are accepted by
<productname>Postgres</productname>, the
<productname>Postgres</productname>, the
retrieve command will cause <productname>Postgres</productname> to crash:
select command will cause <productname>Postgres</productname> to
report an error because the query cycled too many times:
<example>
<example>
<title>Example of a circular rewrite rule combination.</title>
<title>Example of a circular rewrite rule combination.</title>
...
@@ -216,8 +218,9 @@ CREATE RULE bad_rule_combination_2 AS
...
@@ -216,8 +218,9 @@ CREATE RULE bad_rule_combination_2 AS
SELECT TO emp;
SELECT TO emp;
</programlisting>
</programlisting>
<para>
<para>
This attempt to retrieve from EMP will cause
This attempt to select from EMP will cause
<productname>Postgres</productname> to crash.
<productname>Postgres</productname> to issue an error
because the queries cycled too many times.
<programlisting>
<programlisting>
SELECT * FROM emp;
SELECT * FROM emp;
</programlisting></para>
</programlisting></para>
...
@@ -306,7 +309,7 @@ CREATE toyemp(name = char16, salary = int4);
...
@@ -306,7 +309,7 @@ CREATE toyemp(name = char16, salary = int4);
CREATE RULE example_4 AS
CREATE RULE example_4 AS
ON SELECT TO toyemp
ON SELECT TO toyemp
DO INSTEAD
DO INSTEAD
SELECT
(emp.name, emp.salary)
SELECT
emp.name, emp.salary
FROM emp
FROM emp
WHERE emp.dept = "toy";
WHERE emp.dept = "toy";
</programlisting>
</programlisting>
...
@@ -317,7 +320,7 @@ CREATE RULE example_4 AS
...
@@ -317,7 +320,7 @@ CREATE RULE example_4 AS
CREATE RULE example_5 AS
CREATE RULE example_5 AS
ON INERT TO emp WHERE new.salary > 5000
ON INERT TO emp WHERE new.salary > 5000
DO
DO
UPDATE NEWSET salary = 5000;
UPDATE NEWSET
SET
salary = 5000;
</programlisting>
</programlisting>
</para>
</para>
</refsect1>
</refsect1>
...
...
src/backend/utils/adt/formatting.c
View file @
28fb1c19
This diff is collapsed.
Click to expand it.
src/test/regress/expected/int8.out
View file @
28fb1c19
...
@@ -273,7 +273,7 @@ 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'
...
@@ -273,7 +273,7 @@ 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'
| - 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)
(5 rows)
SELECT '' AS to_char_16, to_char(q2, '99999
text
9999 "9999" 999 "\\"text between quote marks\\"" 9999') FROM INT8_TBL;
SELECT '' AS to_char_16, to_char(q2, '99999
"text"
9999 "9999" 999 "\\"text between quote marks\\"" 9999') FROM INT8_TBL;
to_char_16 | to_char
to_char_16 | to_char
------------+-----------------------------------------------------------
------------+-----------------------------------------------------------
| text 9999 "text between quote marks" 456
| text 9999 "text between quote marks" 456
...
...
src/test/regress/expected/numeric.out
View file @
28fb1c19
...
@@ -955,8 +955,8 @@ SELECT '' AS to_char_17, to_char(val, 'FM9999999999999999.99999999999999') FROM
...
@@ -955,8 +955,8 @@ SELECT '' AS to_char_17, to_char(val, 'FM9999999999999999.99999999999999') FROM
| -24926804.04504742
| -24926804.04504742
(10 rows)
(10 rows)
SELECT '' AS to_char_1
5
, 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;
SELECT '' AS to_char_1
8
, 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_1
5
| to_char
to_char_1
8
| 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
| . +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
...
@@ -970,8 +970,8 @@ SELECT '' AS to_char_15, to_char(val, 'S 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 . 9 9 9
...
@@ -970,8 +970,8 @@ SELECT '' AS to_char_15, to_char(val, 'S 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 . 9 9 9
| -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
| -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
(10 rows)
(10 rows)
SELECT '' AS to_char_1
6
, to_char(val, 'FMS 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;
SELECT '' AS to_char_1
9
, to_char(val, 'FMS 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_1
6
| to_char
to_char_1
9
| to_char
------------+-------------------------------------------------------
------------+-------------------------------------------------------
| + 0 .
| + 0 .
| + 0 .
| + 0 .
...
@@ -985,8 +985,8 @@ SELECT '' AS to_char_16, to_char(val, 'FMS 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 . 9 9
...
@@ -985,8 +985,8 @@ SELECT '' AS to_char_16, to_char(val, 'FMS 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 . 9 9
| - 2 4 9 2 6 8 0 4 . 0 4 5 0 4 7 4 2
| - 2 4 9 2 6 8 0 4 . 0 4 5 0 4 7 4 2
(10 rows)
(10 rows)
SELECT '' AS to_char_
17, to_char(val, '99999 text
9999 "9999" 999 "\\"text between quote marks\\"" 9999') FROM num_data;
SELECT '' AS to_char_
20, to_char(val, '99999 "text"
9999 "9999" 999 "\\"text between quote marks\\"" 9999') FROM num_data;
to_char_
17
| to_char
to_char_
20
| to_char
------------+-----------------------------------------------------------
------------+-----------------------------------------------------------
| text 9999 "text between quote marks" 0
| text 9999 "text between quote marks" 0
| text 9999 "text between quote marks" 0
| text 9999 "text between quote marks" 0
...
@@ -1000,8 +1000,8 @@ SELECT '' AS to_char_17, to_char(val, '99999 text 9999 "9999" 999 "\\"text betwe
...
@@ -1000,8 +1000,8 @@ SELECT '' AS to_char_17, to_char(val, '99999 text 9999 "9999" 999 "\\"text betwe
| text -2 9999 492 "text between quote marks" 6804
| text -2 9999 492 "text between quote marks" 6804
(10 rows)
(10 rows)
SELECT '' AS to_char_
18
, to_char(val, '999999SG9999999999') FROM num_data;
SELECT '' AS to_char_
21
, to_char(val, '999999SG9999999999') FROM num_data;
to_char_
18
| to_char
to_char_
21
| to_char
------------+-------------------
------------+-------------------
| + 0
| + 0
| + 0
| + 0
...
@@ -1015,8 +1015,8 @@ SELECT '' AS to_char_18, to_char(val, '999999SG9999999999') FROM num_data;
...
@@ -1015,8 +1015,8 @@ SELECT '' AS to_char_18, to_char(val, '999999SG9999999999') FROM num_data;
| - 24926804
| - 24926804
(10 rows)
(10 rows)
SELECT '' AS to_char_
19
, to_char(val, 'FM9999999999999999.999999999999999') FROM num_data;
SELECT '' AS to_char_
22
, to_char(val, 'FM9999999999999999.999999999999999') FROM num_data;
to_char_
19
| to_char
to_char_
22
| to_char
------------+---------------------
------------+---------------------
| 0.
| 0.
| 0.
| 0.
...
...
src/test/regress/expected/timestamp.out
View file @
28fb1c19
...
@@ -1018,8 +1018,8 @@ SELECT '' AS to_char_2, to_char(d1, 'FMDAY FMDay FMday FMMONTH FMMonth FMmonth F
...
@@ -1018,8 +1018,8 @@ SELECT '' AS to_char_2, to_char(d1, 'FMDAY FMDay FMday FMMONTH FMMonth FMmonth F
SELECT '' AS to_char_3, to_char(d1, 'Y,YYY YYYY YYY YY Y CC Q MM WW DDD DD D J')
SELECT '' AS to_char_3, to_char(d1, 'Y,YYY YYYY YYY YY Y CC Q MM WW DDD DD D J')
FROM TIMESTAMP_TBL;
FROM TIMESTAMP_TBL;
to_char_3 |
to_char
to_char_3 |
to_char
-----------+-------------------------------------------------
------
-----------+-------------------------------------------------
|
|
|
|
|
|
...
@@ -1063,7 +1063,7 @@ SELECT '' AS to_char_3, to_char(d1, 'Y,YYY YYYY YYY YY Y CC Q MM WW DDD DD D J')
...
@@ -1063,7 +1063,7 @@ 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 045 14 6 2450494
| 1,997 1997 997 97 7 20 1 02 06 045 14 6 2450494
| 1,997 1997 997 97 7 20 1 02 06 046 15 7 2450495
| 1,997 1997 997 97 7 20 1 02 06 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
BC 0097 BC
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 06 047 16 7 1756536
| 0,097 0097 097 97 7 01 1 02 06 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
...
@@ -1136,7 +1136,7 @@ SELECT '' AS to_char_4, to_char(d1, 'FMY,YYY FMYYYY FMYYY FMYY FMY FMCC FMQ FMMM
...
@@ -1136,7 +1136,7 @@ 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 45 14 6 2450494
| 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 6 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
BC 97 BC
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 6 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
...
@@ -1381,8 +1381,8 @@ SELECT '' AS to_char_7, to_char(d1, 'HH24--text--MI--text--SS')
...
@@ -1381,8 +1381,8 @@ SELECT '' AS to_char_7, to_char(d1, 'HH24--text--MI--text--SS')
SELECT '' AS to_char_8, to_char(d1, 'YYYYTH YYYYth Jth')
SELECT '' AS to_char_8, to_char(d1, 'YYYYTH YYYYth Jth')
FROM TIMESTAMP_TBL;
FROM TIMESTAMP_TBL;
to_char_8 |
to_char
to_char_8 |
to_char
-----------+-------------------------
------
-----------+-------------------------
|
|
|
|
|
|
...
@@ -1426,7 +1426,7 @@ SELECT '' AS to_char_8, to_char(d1, 'YYYYTH YYYYth Jth')
...
@@ -1426,7 +1426,7 @@ SELECT '' AS to_char_8, to_char(d1, 'YYYYTH YYYYth Jth')
| 1997TH 1997th 2450494th
| 1997TH 1997th 2450494th
| 1997TH 1997th 2450495th
| 1997TH 1997th 2450495th
| 1997TH 1997th 2450496th
| 1997TH 1997th 2450496th
| 0097TH
BC 0097th BC
1686042nd
| 0097TH
0097th
1686042nd
| 0097TH 0097th 1756536th
| 0097TH 0097th 1756536th
| 0597TH 0597th 1939157th
| 0597TH 0597th 1939157th
| 1097TH 1097th 2121778th
| 1097TH 1097th 2121778th
...
@@ -1451,6 +1451,79 @@ SELECT '' AS to_char_8, to_char(d1, 'YYYYTH YYYYth Jth')
...
@@ -1451,6 +1451,79 @@ SELECT '' AS to_char_8, to_char(d1, 'YYYYTH YYYYth Jth')
| 2001ST 2001st 2451911st
| 2001ST 2001st 2451911st
(66 rows)
(66 rows)
SELECT '' AS to_char_9, to_char(d1, 'YYYY A.D. YYYY a.d. YYYY bc HH:MI:SS P.M. HH:MI:SS p.m. HH:MI:SS pm')
FROM TIMESTAMP_TBL;
to_char_9 | to_char
-----------+---------------------------------------------------------------------
|
|
|
| 1970 A.D. 1970 a.d. 1970 ad 12:00:00 A.M. 12:00:00 a.m. 12:00:00 am
| 1997 A.D. 1997 a.d. 1997 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
|
|
| 1997 A.D. 1997 a.d. 1997 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
| 1997 A.D. 1997 a.d. 1997 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
| 1997 A.D. 1997 a.d. 1997 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
| 1997 A.D. 1997 a.d. 1997 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
| 1997 A.D. 1997 a.d. 1997 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
| 1997 A.D. 1997 a.d. 1997 ad 12:00:00 A.M. 12:00:00 a.m. 12:00:00 am
| 1997 A.D. 1997 a.d. 1997 ad 03:04:05 A.M. 03:04:05 a.m. 03:04:05 am
| 1997 A.D. 1997 a.d. 1997 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
| 1997 A.D. 1997 a.d. 1997 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
| 1997 A.D. 1997 a.d. 1997 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
| 1997 A.D. 1997 a.d. 1997 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
| 1997 A.D. 1997 a.d. 1997 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
| 2000 A.D. 2000 a.d. 2000 ad 08:14:01 A.M. 08:14:01 a.m. 08:14:01 am
| 2000 A.D. 2000 a.d. 2000 ad 04:14:02 A.M. 04:14:02 a.m. 04:14:02 am
| 2000 A.D. 2000 a.d. 2000 ad 02:14:03 A.M. 02:14:03 a.m. 02:14:03 am
| 2000 A.D. 2000 a.d. 2000 ad 03:14:04 A.M. 03:14:04 a.m. 03:14:04 am
| 2000 A.D. 2000 a.d. 2000 ad 01:14:05 A.M. 01:14:05 a.m. 01:14:05 am
| 1997 A.D. 1997 a.d. 1997 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
| 1997 A.D. 1997 a.d. 1997 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
| 1997 A.D. 1997 a.d. 1997 ad 05:32:00 P.M. 05:32:00 p.m. 05:32:00 pm
| 1997 A.D. 1997 a.d. 1997 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
| 1997 A.D. 1997 a.d. 1997 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
| 1997 A.D. 1997 a.d. 1997 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
| 1997 A.D. 1997 a.d. 1997 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
| 1997 A.D. 1997 a.d. 1997 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
| 1997 A.D. 1997 a.d. 1997 ad 09:32:01 A.M. 09:32:01 a.m. 09:32:01 am
| 1997 A.D. 1997 a.d. 1997 ad 09:32:01 A.M. 09:32:01 a.m. 09:32:01 am
| 1997 A.D. 1997 a.d. 1997 ad 09:32:01 A.M. 09:32:01 a.m. 09:32:01 am
| 1997 A.D. 1997 a.d. 1997 ad 06:32:01 P.M. 06:32:01 p.m. 06:32:01 pm
| 1997 A.D. 1997 a.d. 1997 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
| 1997 A.D. 1997 a.d. 1997 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
| 1997 A.D. 1997 a.d. 1997 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
| 1997 A.D. 1997 a.d. 1997 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
| 1997 A.D. 1997 a.d. 1997 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
| 1997 A.D. 1997 a.d. 1997 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
| 1997 A.D. 1997 a.d. 1997 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
| 0097 B.C. 0097 b.c. 0097 bc 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
| 0097 A.D. 0097 a.d. 0097 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
| 0597 A.D. 0597 a.d. 0597 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
| 1097 A.D. 1097 a.d. 1097 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
| 1697 A.D. 1697 a.d. 1697 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
| 1797 A.D. 1797 a.d. 1797 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
| 1897 A.D. 1897 a.d. 1897 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
| 1997 A.D. 1997 a.d. 1997 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
| 2097 A.D. 2097 a.d. 2097 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
| 1996 A.D. 1996 a.d. 1996 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
| 1996 A.D. 1996 a.d. 1996 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
| 1996 A.D. 1996 a.d. 1996 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
| 1996 A.D. 1996 a.d. 1996 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
| 1996 A.D. 1996 a.d. 1996 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
| 1997 A.D. 1997 a.d. 1997 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
| 1997 A.D. 1997 a.d. 1997 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
| 1997 A.D. 1997 a.d. 1997 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
| 1997 A.D. 1997 a.d. 1997 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
| 1997 A.D. 1997 a.d. 1997 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
| 1999 A.D. 1999 a.d. 1999 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
| 2000 A.D. 2000 a.d. 2000 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
| 2000 A.D. 2000 a.d. 2000 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
| 2001 A.D. 2001 a.d. 2001 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
(66 rows)
-- TO_TIMESTAMP()
-- TO_TIMESTAMP()
--
--
SELECT '' AS to_timestamp_1, to_timestamp('0097/Feb/16 --> 08:14:30', 'YYYY/Mon/DD --> HH:MI:SS');
SELECT '' AS to_timestamp_1, to_timestamp('0097/Feb/16 --> 08:14:30', 'YYYY/Mon/DD --> HH:MI:SS');
...
...
src/test/regress/sql/int8.sql
View file @
28fb1c19
...
@@ -52,5 +52,5 @@ SELECT '' AS to_char_12, to_char(q2, 'FM9999999999999999.000') FROM INT8_TBL;
...
@@ -52,5 +52,5 @@ SELECT '' AS to_char_12, to_char(q2, 'FM9999999999999999.000') FROM INT8_TBL;
SELECT
''
AS
to_char_13
,
to_char
(
q2
,
'L9999999999999999.000'
)
FROM
INT8_TBL
;
SELECT
''
AS
to_char_13
,
to_char
(
q2
,
'L9999999999999999.000'
)
FROM
INT8_TBL
;
SELECT
''
AS
to_char_14
,
to_char
(
q2
,
'FM9999999999999999.999'
)
FROM
INT8_TBL
;
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
;
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
;
SELECT
''
AS
to_char_16
,
to_char
(
q2
,
'99999
text
9999 "9999" 999 "
\\
"text between quote marks
\\
"" 9999'
)
FROM
INT8_TBL
;
SELECT
''
AS
to_char_16
,
to_char
(
q2
,
'99999
"text"
9999 "9999" 999 "
\\
"text between quote marks
\\
"" 9999'
)
FROM
INT8_TBL
;
SELECT
''
AS
to_char_17
,
to_char
(
q2
,
'999999SG9999999999'
)
FROM
INT8_TBL
;
SELECT
''
AS
to_char_17
,
to_char
(
q2
,
'999999SG9999999999'
)
FROM
INT8_TBL
;
src/test/regress/sql/numeric.sql
View file @
28fb1c19
...
@@ -680,11 +680,11 @@ SELECT '' AS to_char_14, to_char(val, 'FM0999999999999999.999909999999999') FRO
...
@@ -680,11 +680,11 @@ SELECT '' AS to_char_14, to_char(val, 'FM0999999999999999.999909999999999') FRO
SELECT
''
AS
to_char_15
,
to_char
(
val
,
'FM9999999990999999.099999999999999'
)
FROM
num_data
;
SELECT
''
AS
to_char_15
,
to_char
(
val
,
'FM9999999990999999.099999999999999'
)
FROM
num_data
;
SELECT
''
AS
to_char_16
,
to_char
(
val
,
'L9999999999999999.099999999999999'
)
FROM
num_data
;
SELECT
''
AS
to_char_16
,
to_char
(
val
,
'L9999999999999999.099999999999999'
)
FROM
num_data
;
SELECT
''
AS
to_char_17
,
to_char
(
val
,
'FM9999999999999999.99999999999999'
)
FROM
num_data
;
SELECT
''
AS
to_char_17
,
to_char
(
val
,
'FM9999999999999999.99999999999999'
)
FROM
num_data
;
SELECT
''
AS
to_char_1
5
,
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
;
SELECT
''
AS
to_char_1
8
,
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
;
SELECT
''
AS
to_char_1
6
,
to_char
(
val
,
'FMS 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
;
SELECT
''
AS
to_char_1
9
,
to_char
(
val
,
'FMS 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
;
SELECT
''
AS
to_char_
17
,
to_char
(
val
,
'99999 text
9999 "9999" 999 "
\\
"text between quote marks
\\
"" 9999'
)
FROM
num_data
;
SELECT
''
AS
to_char_
20
,
to_char
(
val
,
'99999 "text"
9999 "9999" 999 "
\\
"text between quote marks
\\
"" 9999'
)
FROM
num_data
;
SELECT
''
AS
to_char_
18
,
to_char
(
val
,
'999999SG9999999999'
)
FROM
num_data
;
SELECT
''
AS
to_char_
21
,
to_char
(
val
,
'999999SG9999999999'
)
FROM
num_data
;
SELECT
''
AS
to_char_
19
,
to_char
(
val
,
'FM9999999999999999.999999999999999'
)
FROM
num_data
;
SELECT
''
AS
to_char_
22
,
to_char
(
val
,
'FM9999999999999999.999999999999999'
)
FROM
num_data
;
-- TO_NUMBER()
-- TO_NUMBER()
--
--
...
...
src/test/regress/sql/timestamp.sql
View file @
28fb1c19
...
@@ -199,6 +199,9 @@ SELECT '' AS to_char_7, to_char(d1, 'HH24--text--MI--text--SS')
...
@@ -199,6 +199,9 @@ SELECT '' AS to_char_7, to_char(d1, 'HH24--text--MI--text--SS')
SELECT
''
AS
to_char_8
,
to_char
(
d1
,
'YYYYTH YYYYth Jth'
)
SELECT
''
AS
to_char_8
,
to_char
(
d1
,
'YYYYTH YYYYth Jth'
)
FROM
TIMESTAMP_TBL
;
FROM
TIMESTAMP_TBL
;
SELECT
''
AS
to_char_9
,
to_char
(
d1
,
'YYYY A.D. YYYY a.d. YYYY bc HH:MI:SS P.M. HH:MI:SS p.m. HH:MI:SS pm'
)
FROM
TIMESTAMP_TBL
;
-- TO_TIMESTAMP()
-- TO_TIMESTAMP()
--
--
...
...
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