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
df770717
Commit
df770717
authored
Apr 27, 1997
by
Marc G. Fournier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Massive regression test patches from Thomas *woo hoo!*
parent
a902829a
Changes
24
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
24 changed files
with
1752 additions
and
1939 deletions
+1752
-1939
src/backend/utils/adt/dt.c
src/backend/utils/adt/dt.c
+24
-9
src/test/regress/GNUmakefile
src/test/regress/GNUmakefile
+2
-2
src/test/regress/README
src/test/regress/README
+98
-22
src/test/regress/data/stud_emp.data
src/test/regress/data/stud_emp.data
+3
-3
src/test/regress/expected/abstime.out
src/test/regress/expected/abstime.out
+105
-136
src/test/regress/expected/boolean.out
src/test/regress/expected/boolean.out
+3
-3
src/test/regress/expected/box.out
src/test/regress/expected/box.out
+73
-73
src/test/regress/expected/int2.out
src/test/regress/expected/int2.out
+1
-1
src/test/regress/expected/int4.out
src/test/regress/expected/int4.out
+1
-1
src/test/regress/expected/misc.out
src/test/regress/expected/misc.out
+1198
-1474
src/test/regress/expected/oidint2.out
src/test/regress/expected/oidint2.out
+1
-1
src/test/regress/expected/oidint4.out
src/test/regress/expected/oidint4.out
+1
-1
src/test/regress/expected/point.out
src/test/regress/expected/point.out
+106
-77
src/test/regress/expected/polygon.out
src/test/regress/expected/polygon.out
+35
-35
src/test/regress/expected/select.out
src/test/regress/expected/select.out
+0
-2
src/test/regress/expected/tinterval.out
src/test/regress/expected/tinterval.out
+54
-56
src/test/regress/input/Makefile
src/test/regress/input/Makefile
+3
-2
src/test/regress/output/create_function_1.source
src/test/regress/output/create_function_1.source
+4
-4
src/test/regress/output/create_function_2.source
src/test/regress/output/create_function_2.source
+1
-1
src/test/regress/regress.sh
src/test/regress/regress.sh
+14
-13
src/test/regress/sql/Makefile
src/test/regress/sql/Makefile
+2
-2
src/test/regress/sql/abstime.sql
src/test/regress/sql/abstime.sql
+13
-13
src/test/regress/sql/point.sql
src/test/regress/sql/point.sql
+7
-8
src/test/regress/sql/tests
src/test/regress/sql/tests
+3
-0
No files found.
src/backend/utils/adt/dt.c
View file @
df770717
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/dt.c,v 1.1
7 1997/04/25 18:40:13
scrappy Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/dt.c,v 1.1
8 1997/04/27 02:55:49
scrappy Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -455,6 +455,9 @@ timespan_ne(TimeSpan *timespan1, TimeSpan *timespan2)
if
(
!
PointerIsValid
(
timespan1
)
||
!
PointerIsValid
(
timespan2
))
return
FALSE
;
if
(
TIMESPAN_IS_INVALID
(
*
timespan1
)
||
TIMESPAN_IS_INVALID
(
*
timespan2
))
return
FALSE
;
return
(
(
timespan1
->
time
!=
timespan2
->
time
)
||
(
timespan1
->
month
!=
timespan2
->
month
));
}
/* timespan_ne() */
...
...
@@ -467,10 +470,13 @@ timespan_lt(TimeSpan *timespan1, TimeSpan *timespan2)
if
(
!
PointerIsValid
(
timespan1
)
||
!
PointerIsValid
(
timespan2
))
return
FALSE
;
if
(
TIMESPAN_IS_INVALID
(
*
timespan1
)
||
TIMESPAN_IS_INVALID
(
*
timespan2
))
return
FALSE
;
span1
=
timespan1
->
time
;
if
(
timespan1
->
month
!=
0
)
span1
+=
(
timespan1
->
month
*
30
);
if
(
timespan1
->
month
!=
0
)
span1
+=
(
timespan1
->
month
*
(
30
*
86400
)
);
span2
=
timespan2
->
time
;
if
(
timespan2
->
month
!=
0
)
span2
+=
(
timespan2
->
month
*
30
);
if
(
timespan2
->
month
!=
0
)
span2
+=
(
timespan2
->
month
*
(
30
*
86400
)
);
return
(
span1
<
span2
);
}
/* timespan_lt() */
...
...
@@ -483,10 +489,13 @@ timespan_gt(TimeSpan *timespan1, TimeSpan *timespan2)
if
(
!
PointerIsValid
(
timespan1
)
||
!
PointerIsValid
(
timespan2
))
return
FALSE
;
if
(
TIMESPAN_IS_INVALID
(
*
timespan1
)
||
TIMESPAN_IS_INVALID
(
*
timespan2
))
return
FALSE
;
span1
=
timespan1
->
time
;
if
(
timespan1
->
month
!=
0
)
span1
+=
(
timespan1
->
month
*
30
);
if
(
timespan1
->
month
!=
0
)
span1
+=
(
timespan1
->
month
*
(
30
*
86400
)
);
span2
=
timespan2
->
time
;
if
(
timespan2
->
month
!=
0
)
span2
+=
(
timespan2
->
month
*
30
);
if
(
timespan2
->
month
!=
0
)
span2
+=
(
timespan2
->
month
*
(
30
*
86400
)
);
return
(
span1
>
span2
);
}
/* timespan_gt() */
...
...
@@ -499,10 +508,13 @@ timespan_le(TimeSpan *timespan1, TimeSpan *timespan2)
if
(
!
PointerIsValid
(
timespan1
)
||
!
PointerIsValid
(
timespan2
))
return
FALSE
;
if
(
TIMESPAN_IS_INVALID
(
*
timespan1
)
||
TIMESPAN_IS_INVALID
(
*
timespan2
))
return
FALSE
;
span1
=
timespan1
->
time
;
if
(
timespan1
->
month
!=
0
)
span1
+=
(
timespan1
->
month
*
30
);
if
(
timespan1
->
month
!=
0
)
span1
+=
(
timespan1
->
month
*
(
30
*
86400
)
);
span2
=
timespan2
->
time
;
if
(
timespan2
->
month
!=
0
)
span2
+=
(
timespan2
->
month
*
30
);
if
(
timespan2
->
month
!=
0
)
span2
+=
(
timespan2
->
month
*
(
30
*
86400
)
);
return
(
span1
<=
span2
);
}
/* timespan_le() */
...
...
@@ -515,10 +527,13 @@ timespan_ge(TimeSpan *timespan1, TimeSpan *timespan2)
if
(
!
PointerIsValid
(
timespan1
)
||
!
PointerIsValid
(
timespan2
))
return
FALSE
;
if
(
TIMESPAN_IS_INVALID
(
*
timespan1
)
||
TIMESPAN_IS_INVALID
(
*
timespan2
))
return
FALSE
;
span1
=
timespan1
->
time
;
if
(
timespan1
->
month
!=
0
)
span1
+=
(
timespan1
->
month
*
30
);
if
(
timespan1
->
month
!=
0
)
span1
+=
(
timespan1
->
month
*
(
30
*
86400
)
);
span2
=
timespan2
->
time
;
if
(
timespan2
->
month
!=
0
)
span2
+=
(
timespan2
->
month
*
30
);
if
(
timespan2
->
month
!=
0
)
span2
+=
(
timespan2
->
month
*
(
30
*
86400
)
);
return
(
span1
>=
span2
);
}
/* timespan_ge() */
...
...
src/test/regress/GNUmakefile
View file @
df770717
...
...
@@ -7,14 +7,14 @@
#
#
# IDENTIFICATION
# $Header: /cvsroot/pgsql/src/test/regress/GNUmakefile,v 1.
6 1997/04/26 06:31:55
scrappy Exp $
# $Header: /cvsroot/pgsql/src/test/regress/GNUmakefile,v 1.
7 1997/04/27 02:56:03
scrappy Exp $
#
#-------------------------------------------------------------------------
SRCDIR
=
../..
include
../../Makefile.global
CFLAGS
+=
-I
$(LIBPQDIR)
CFLAGS
+=
-I
$(LIBPQDIR)
-I
../../include
LDADD
+=
-L
$(LIBPQDIR)
-lpq
...
...
src/test/regress/README
View file @
df770717
...
...
@@ -2,23 +2,39 @@
Introduction
The PostgreSQL regression tests are a comprehensive set of tests for the
SQL implementation embeded in PostgreSQL developed by Jolly Chen and
Andrew Yu. It tests standard SQL operations as well as the extens
a
bility
SQL implementation embed
d
ed in PostgreSQL developed by Jolly Chen and
Andrew Yu. It tests standard SQL operations as well as the extens
i
bility
capabilities of PostgreSQL.
These tests have recently been revised by Marc Fournier and others to
become current for PostgreSQL v6.1. The tests are now packaged as
functional units and should be easier to run and easier to interpret.
Some properly installed and fully functional PostgreSQL installations
can fail these regression tests due to artifacts of the genetic optimizer.
See the v6.1-specific release notes in this document for further details.
Preparation
The regression test is invoked
thru
by the 'make' command which compiles
The regression test is invoked by the 'make' command which compiles
a 'c' program with PostgreSQL extension functions into a shared library
in the current directory. Localized shell scripts are also created in
the current directory. The
'expected.input' file is
massaged into the
'expected.out' file
. The localization replaces macros in the source
the current directory. The
output file templates are
massaged into the
./expected/*.out files
. The localization replaces macros in the source
files with absolute pathnames and user names.
The postmaster should be invoked with the system time zone set for
Berkeley, California. On some systems, this can be accomplished by
setting the TZ environment variable before starting the postmaster
(for csh/bash; use set/export for some other shells):
setenv TZ PST8PDT7,M04.01.0,M10.05.03
/usr/local/pgsql/bin/postmaster -s
Directory Layout
input/ .... .source files that are converted using 'make all' into
.sql files in the 'sql' subdirectory
some of the
.sql files in the 'sql' subdirectory
output/ ... .source files that are converted using 'make all' into
.out files in the 'expected' subdirectory
...
...
@@ -29,7 +45,7 @@ Directory Layout
look like
results/ .. .out files that represent what the results *actually* look
like
like
. Also used as temporary storage for table copy testing.
Running the regression test
...
...
@@ -45,14 +61,14 @@ Running the regression test
Normally, the regression test should be run as the pg_superuser as the
'src/test/regress' directory and sub-directories are owned by the
pg_superuser. If you run the regression test as another user the
'src/test/regress' directory should be writeable to that user.
'src/test/regress' directory
tree
should be writeable to that user.
Comparing expected/actual output
The results are in the file
'regress.out' which can be compared
with the 'expected.out' file using 'diff'. The files will NOT
compare exactly. The following paragraphs attempt to explain the
differences.
The results are in the file
s in the ./results directory. These
results can be compared with results in the ./expected directory
using 'diff'. The files might not compare exactly. The following
paragraphs attempt to explain the
differences.
OID differences
...
...
@@ -62,7 +78,7 @@ OID differences
If you run the regression test on a non-virgin database or run it multiple
times, the OID's reported will have different values.
The following SQL statements in '
regress
.out' have shown this behavior:
The following SQL statements in '
misc
.out' have shown this behavior:
QUERY: SELECT user_relns() AS user_relns ORDER BY user_relns;
...
...
@@ -96,8 +112,8 @@ POLYGON differences
Several of the tests involve operations on geographic date about the
Oakland/Berkley CA street map. The map data is expressed as polygons
whose vertic
ies are represen
ed as pairs of FLOAT8 numbers (decimal
lat
t
itude and longitude). Initially, some tables are created and
whose vertic
es are represent
ed as pairs of FLOAT8 numbers (decimal
latitude and longitude). Initially, some tables are created and
loaded with geographic data, then some views are created which join
two tables using the polygon intersection operator (##), then a select
is done on the view.
...
...
@@ -111,24 +127,84 @@ POLYGON differences
DATE/TIME differences
On many supported platforms, you can force PostgreSQL to believe that it
is running in the same time zone as Berkeley, California. See details in
the section on how to run the regression tests.
The Makefile attempts to adjust for timezone differences, but it is
totally possible to
eliminate them. People outside North America
not possible to totally
eliminate them. People outside North America
will probabablly find the Makefile's adjustments are incorrect. Also
entries that use the time -infinity display with year 1970 plus/minus the
number of hours you are different from GMT.
--------[ old stuff that needs to be rewritten ]-----
Random differences
There is at least one test case in misc.out which is intended to produce
random results. This causes misc to fail the regression testing.
Typing "diff results/misc.out expected/misc.out" should produce only
one or a few lines of differences for this reason, but other floating
point differences on dissimilar architectures might cause many more
differences.
The 'expected
.input' file and the 'sample.regress.out' file
The 'expected
' files
The 'expected.input' file was created on a SPARC Solaris 2.4 system
using the 'postgres5-1.02a5.tar.gz' source tree. It has been compared
The ./expected/*.out files were adapted from the original monolithic
'expected.input' file provided by Jolly Chen et al. Newer versions of these
files generated on various development machines have been substituted after
careful (?) inspection. Many of the development machines are running a
Unix OS variant (FreeBSD, Linux, etc) on Ix86 hardware.
The original 'expected.input' file was created on a SPARC Solaris 2.4
system using the 'postgres5-1.02a5.tar.gz' source tree. It was compared
with a file created on an I386 Solaris 2.4 system and the differences
a
re only in the floating point polygons in the 3rd digit to the right
we
re only in the floating point polygons in the 3rd digit to the right
of the decimal point. (see below)
The
'sample.regress.out' file i
s from the postgres-1.01 release
The
original 'sample.regress.out' file wa
s from the postgres-1.01 release
constructed by Jolly Chen and is included here for reference. It may
have been created on a DEC ALPHA machine as the 'Makefile.global'
in the postgres-1.01 release has PORTNAME=alpha.
Current release notes
There are no release notes for PostgreSQL v6.0.
v6.1beta release notes
The regression tests have been adapted and extensively modified for the
v6.1 release of PostgreSQL.
Three new data types (datetime, timespan, and circle) have been added to
the native set of PostgreSQL types. Points, boxes, paths, and polygons
have had their output formats improved, but the old-style input formats
are accepted by v6.1. The source data files have not been updated to the
new formats, but should be for the next release. The polygon output in
misc.out has only been spot-checked for correctness relative to the
original regression output.
To get consistant results from the regression tests, compile the PostgreSQL
backend with the genetic optimizer (GEQ) turned off. The genetic algorithms
introduce a random behavior in the output ordering which causes the
simple "diff" implementation of the tests to fail. To turn off the genetic
optimizer, edit the src/include/config.h file and comment-out the line
containing "#define GEQ", then do a "make clean install" to regenerate
the backend. Existing v6.1 databases are not affected by the choice of
optimizer, so there is no need to reload after changing the optimizer.
The new genetic optimizer has very nice performance with many-table joins,
so you may want to make sure to re-enable it and reinstall the code after
you have concluded your regression testing.
XXX update this for the production release - tgl 97/04/26
The interpretation of array specifiers (the curly braces around atomic
values) appears to have changed sometime after the original regression
tests were generated. The current ./expected/*.out files reflect this
new interpretation, which may not be correct!
XXX update this for the production release - tgl 97/04/26
The float8 regression test fails. This may be due to the parser continuing
rather than aborting when given invalid constants for input values.
XXX update this for the production release - tgl 97/04/26
Regression tests involving indexed tables fail in at least some environments.
This may indicate a problem with the current index code.
src/test/regress/data/stud_emp.data
View file @
df770717
jeff 23 (8,7.7) 600 sharon 3.50000000000000000e+00
cim 30 (10.5,4.7) 400
3.39999999999999990e+00
linda 19 (0.9,6.1) 100
2.89999999999999990e+00
jeff 23 (8,7.7) 600 sharon 3.50000000000000000e+00
\N
cim 30 (10.5,4.7) 400
\N 3.39999999999999990e+00 \N
linda 19 (0.9,6.1) 100
\N 2.89999999999999990e+00 \N
src/test/regress/expected/abstime.out
View file @
df770717
This diff is collapsed.
Click to expand it.
src/test/regress/expected/boolean.out
View file @
df770717
...
...
@@ -162,18 +162,18 @@ tf_12_ff_4|f1|f1
|t |f
|t |f
|t |f
|f |f
|t |f
|t |f
|t |f
|f |f
|t |f
|t |f
|t |f
|f |f
|t |f
|t |f
|t |f
|f |f
|f |f
|f |f
|f |f
(16 rows)
src/test/regress/expected/box.out
View file @
df770717
...
...
@@ -8,145 +8,145 @@ WARN:Bad box external representation '(2.3, 4.5)'
QUERY: INSERT INTO BOX_TBL (f1) VALUES ('asdfasdf(ad');
WARN:Bad box external representation 'asdfasdf(ad'
QUERY: SELECT '' AS four, BOX_TBL.*;
four|f1
----+-----------------
|(2,2
,
0,0)
|(3,3
,
1,1)
|(2.5,3.5
,
2.5,2.5)
|(3,3
,
3,3)
four|f1
----+-----------------
--
|(2,2
),(
0,0)
|(3,3
),(
1,1)
|(2.5,3.5
),(
2.5,2.5)
|(3,3
),(
3,3)
(4 rows)
QUERY: SELECT '' AS four, b.*, box_area(b.f1) as barea
FROM BOX_TBL b;
four|f1 |barea
----+-----------------+-----
|(2,2
,
0,0) | 4
|(3,3
,
1,1) | 4
|(2.5,3.5
,
2.5,2.5)| 0
|(3,3
,
3,3) | 0
four|f1
|barea
----+-----------------
--
+-----
|(2,2
),(
0,0) | 4
|(3,3
),(
1,1) | 4
|(2.5,3.5
),(
2.5,2.5)| 0
|(3,3
),(
3,3) | 0
(4 rows)
QUERY: SELECT '' AS three, b.f1
FROM BOX_TBL b
WHERE b.f1 && '(2.5,2.5,1.0,1.0)'::box;
three|f1
-----+-----------------
|(2,2
,
0,0)
|(3,3
,
1,1)
|(2.5,3.5
,
2.5,2.5)
three|f1
-----+-----------------
--
|(2,2
),(
0,0)
|(3,3
),(
1,1)
|(2.5,3.5
),(
2.5,2.5)
(3 rows)
QUERY: SELECT '' AS two, b1.*
FROM BOX_TBL b1
WHERE b1.f1 &< '(2.0,2.0,2.5,2.5)'::box;
two|f1
---+-----------------
|(2,2
,
0,0)
|(2.5,3.5
,
2.5,2.5)
two|f1
---+-----------------
--
|(2,2
),(
0,0)
|(2.5,3.5
),(
2.5,2.5)
(2 rows)
QUERY: SELECT '' AS two, b1.*
FROM BOX_TBL b1
WHERE b1.f1 &> '(2.0,2.0,2.5,2.5)'::box;
two|f1
---+-----------------
|(2.5,3.5
,
2.5,2.5)
|(3,3
,
3,3)
two|f1
---+-----------------
--
|(2.5,3.5
),(
2.5,2.5)
|(3,3
),(
3,3)
(2 rows)
QUERY: SELECT '' AS two, b.f1
FROM BOX_TBL b
WHERE b.f1 << '(3.0,3.0,5.0,5.0)'::box;
two|f1
---+-----------------
|(2,2
,
0,0)
|(2.5,3.5
,
2.5,2.5)
two|f1
---+-----------------
--
|(2,2
),(
0,0)
|(2.5,3.5
),(
2.5,2.5)
(2 rows)
QUERY: SELECT '' AS four, b.f1
FROM BOX_TBL b
WHERE b.f1 <= '(3.0,3.0,5.0,5.0)'::box;
four|f1
----+-----------------
|(2,2
,
0,0)
|(3,3
,
1,1)
|(2.5,3.5
,
2.5,2.5)
|(3,3
,
3,3)
four|f1
----+-----------------
--
|(2,2
),(
0,0)
|(3,3
),(
1,1)
|(2.5,3.5
),(
2.5,2.5)
|(3,3
),(
3,3)
(4 rows)
QUERY: SELECT '' AS two, b.f1
FROM BOX_TBL b
WHERE b.f1 < '(3.0,3.0,5.0,5.0)'::box;
two|f1
---+-----------------
|(2.5,3.5
,
2.5,2.5)
|(3,3
,
3,3)
two|f1
---+-----------------
--
|(2.5,3.5
),(
2.5,2.5)
|(3,3
),(
3,3)
(2 rows)
QUERY: SELECT '' AS two, b.f1
FROM BOX_TBL b
WHERE b.f1 = '(3.0,3.0,5.0,5.0)'::box;
two|f1
---+---------
|(2,2
,
0,0)
|(3,3
,
1,1)
two|f1
---+---------
--
|(2,2
),(
0,0)
|(3,3
),(
1,1)
(2 rows)
QUERY: SELECT '' AS two, b.f1
FROM BOX_TBL b
WHERE b.f1 > '(3.5,3.0,4.5,3.0)'::box;
two|f1
---+---------
|(2,2
,
0,0)
|(3,3
,
1,1)
two|f1
---+---------
--
|(2,2
),(
0,0)
|(3,3
),(
1,1)
(2 rows)
QUERY: SELECT '' AS four, b.f1
FROM BOX_TBL b
WHERE b.f1 >= '(3.5,3.0,4.5,3.0)'::box;
four|f1
----+-----------------
|(2,2
,
0,0)
|(3,3
,
1,1)
|(2.5,3.5
,
2.5,2.5)
|(3,3
,
3,3)
four|f1
----+-----------------
--
|(2,2
),(
0,0)
|(3,3
),(
1,1)
|(2.5,3.5
),(
2.5,2.5)
|(3,3
),(
3,3)
(4 rows)
QUERY: SELECT '' AS two, b.f1
FROM BOX_TBL b
WHERE '(3.0,3.0,5.0,5.0)'::box >> b.f1;
two|f1
---+-----------------
|(2,2
,
0,0)
|(2.5,3.5
,
2.5,2.5)
two|f1
---+-----------------
--
|(2,2
),(
0,0)
|(2.5,3.5
),(
2.5,2.5)
(2 rows)
QUERY: SELECT '' AS three, b.f1
FROM BOX_TBL b
WHERE b.f1 @ '(0,0,3,3)'::box;
three|f1
-----+---------
|(2,2
,
0,0)
|(3,3
,
1,1)
|(3,3
,
3,3)
three|f1
-----+---------
--
|(2,2
),(
0,0)
|(3,3
),(
1,1)
|(3,3
),(
3,3)
(3 rows)
QUERY: SELECT '' AS three, b.f1
FROM BOX_TBL b
WHERE '(0,0,3,3)'::box ~ b.f1;
three|f1
-----+---------
|(2,2
,
0,0)
|(3,3
,
1,1)
|(3,3
,
3,3)
three|f1
-----+---------
--
|(2,2
),(
0,0)
|(3,3
),(
1,1)
|(3,3
),(
3,3)
(3 rows)
QUERY: SELECT '' AS one, b.f1
FROM BOX_TBL b
WHERE '(1,1,3,3)'::box ~= b.f1;
one|f1
---+---------
|(3,3
,
1,1)
one|f1
---+---------
--
|(3,3
),(
1,1)
(1 row)
QUERY: SELECT '' AS four, @@(b1.f1) AS p
...
...
@@ -162,8 +162,8 @@ four|p
QUERY: SELECT '' AS one, b1.*, b2.*
FROM BOX_TBL b1, BOX_TBL b2
WHERE b1.f1 ~ b2.f1 and not b1.f1 ~= b2.f1;
one|f1
|f1
---+---------
+
---------
|(3,3
,1,1)|(3,3,
3,3)
one|f1
|f1
---+---------
--+--
---------
|(3,3
),(1,1)|(3,3),(
3,3)
(1 row)
src/test/regress/expected/int2.out
View file @
df770717
...
...
@@ -7,7 +7,7 @@ WARN:pg_atoi: error in "34.5": can't parse ".5"
QUERY: INSERT INTO INT2_TBL(f1) VALUES ('32767');
QUERY: INSERT INTO INT2_TBL(f1) VALUES ('-32767');
QUERY: INSERT INTO INT2_TBL(f1) VALUES ('100000');
WARN:pg_atoi: error reading "100000":
Result too larg
e
WARN:pg_atoi: error reading "100000":
Math result not representabl
e
QUERY: INSERT INTO INT2_TBL(f1) VALUES ('asdf');
WARN:pg_atoi: error in "asdf": can't parse "asdf"
QUERY: SELECT '' AS five, INT2_TBL.*;
...
...
src/test/regress/expected/int4.out
View file @
df770717
...
...
@@ -7,7 +7,7 @@ WARN:pg_atoi: error in "34.5": can't parse ".5"
QUERY: INSERT INTO INT4_TBL(f1) VALUES ('2147483647');
QUERY: INSERT INTO INT4_TBL(f1) VALUES ('-2147483647');
QUERY: INSERT INTO INT4_TBL(f1) VALUES ('1000000000000');
WARN:pg_atoi: error reading "1000000000000":
Result too larg
e
WARN:pg_atoi: error reading "1000000000000":
Math result not representabl
e
QUERY: INSERT INTO INT4_TBL(f1) VALUES ('asdf');
WARN:pg_atoi: error in "asdf": can't parse "asdf"
QUERY: SELECT '' AS five, INT4_TBL.*;
...
...
src/test/regress/expected/misc.out
View file @
df770717
This diff is collapsed.
Click to expand it.
src/test/regress/expected/oidint2.out
View file @
df770717
...
...
@@ -4,7 +4,7 @@ QUERY: INSERT INTO OIDINT2_TBL(f1) VALUES ('1235/9873');
QUERY: INSERT INTO OIDINT2_TBL(f1) VALUES ('987/-1234');
QUERY: INSERT INTO OIDINT2_TBL(f1) VALUES ('123456');
QUERY: INSERT INTO OIDINT2_TBL(f1) VALUES ('123456/123456');
WARN:pg_atoi: error reading "123456":
Result too larg
e
WARN:pg_atoi: error reading "123456":
Math result not representabl
e
QUERY: INSERT INTO OIDINT2_TBL(f1) VALUES ('');
QUERY: INSERT INTO OIDINT2_TBL(f1) VALUES ('asdfasd');
WARN:pg_atoi: error in "asdfasd": can't parse "asdfasd"
...
...
src/test/regress/expected/oidint4.out
View file @
df770717
...
...
@@ -4,7 +4,7 @@ QUERY: INSERT INTO OIDINT4_TBL(f1) VALUES ('1235/9873');
QUERY: INSERT INTO OIDINT4_TBL(f1) VALUES ('987/-1234');
QUERY: INSERT INTO OIDINT4_TBL(f1) VALUES ('123456');
QUERY: INSERT INTO OIDINT4_TBL(f1) VALUES ('123456/1234568901234567890');
WARN:pg_atoi: error reading "1234568901234567890":
Result too larg
e
WARN:pg_atoi: error reading "1234568901234567890":
Math result not representabl
e
QUERY: INSERT INTO OIDINT4_TBL(f1) VALUES ('');
QUERY: INSERT INTO OIDINT4_TBL(f1) VALUES ('asdfasd');
WARN:pg_atoi: error in "asdfasd": can't parse "asdfasd"
...
...
src/test/regress/expected/point.out
View file @
df770717
...
...
@@ -7,20 +7,20 @@ QUERY: INSERT INTO POINT_TBL(f1) VALUES ('(-5.0,-12.0)');
QUERY: INSERT INTO POINT_TBL(f1) VALUES ('asdfasdf');
WARN:Bad point external representation 'asdfasdf'
QUERY: INSERT INTO POINT_TBL(f1) VALUES ('10.0,10.0');
WARN:Bad point external representation '10.0,10.0'
QUERY: INSERT INTO POINT_TBL(f1) VALUES ('(10.0 10.0)');
WARN:Bad point external representation '(10.0 10.0)'
QUERY: INSERT INTO POINT_TBL(f1) VALUES ('(10.0,10.0');
WARN:Bad point external representation '(10.0,10.0'
QUERY: SELECT '' AS five, POINT_TBL.*;
five|f1
----+----------
|(0,0)
|(-10,0)
|(-3,4)
|(5.1,34.5)
|(-5,-12)
(5 rows)
QUERY: SELECT '' AS six, POINT_TBL.*;
six|f1
---+----------
|(0,0)
|(-10,0)
|(-3,4)
|(5.1,34.5)
|(-5,-12)
|(10,10)
(6 rows)
QUERY: SELECT '' AS three, p.* FROM POINT_TBL p WHERE p.f1 !< '(0.0, 0.0)';
three|f1
...
...
@@ -56,13 +56,14 @@ one|f1
|(5.1,34.5)
(1 row)
QUERY: SELECT '' AS t
wo
, p.* FROM POINT_TBL p
QUERY: SELECT '' AS t
hree
, p.* FROM POINT_TBL p
WHERE p.f1 ===> '(0,0,100,100)';
two|f1
---+----------
|(0,0)
|(5.1,34.5)
(2 rows)
three|f1
-----+----------
|(0,0)
|(5.1,34.5)
|(10,10)
(3 rows)
QUERY: SELECT '' AS three, p.* FROM POINT_TBL p
WHERE not on_pb(p.f1,'(0,0,100,100)'::box);
...
...
@@ -81,100 +82,128 @@ two|f1
|(-10,0)
(2 rows)
QUERY: SELECT '' AS five, p.f1, p.f1 <===> '(0,0)' AS dist FROM POINT_TBL p;
five|f1 |dist
----+----------+----
|(0,0) | 0
|(-10,0) | 10
|(-3,4) | 5
|(5.1,34.5)| 34
|(-5,-12) | 13
(5 rows)
QUERY: SELECT '' AS six, p.f1, p.f1 <===> '(0,0)'::point AS dist FROM POINT_TBL p;
six|f1 | dist
---+----------+----------------
|(0,0) | 0
|(-10,0) | 10
|(-3,4) | 5
|(5.1,34.5)|34.8749193547455
|(-5,-12) | 13
|(10,10) | 14.142135623731
(6 rows)
QUERY: SELECT '' AS t
wentyfive
, p1.f1, p2.f1, p1.f1 <===> p2.f1 AS dist
QUERY: SELECT '' AS t
hirtysix
, p1.f1, p2.f1, p1.f1 <===> p2.f1 AS dist
FROM POINT_TBL p1, POINT_TBL p2;
twentyfive|f1 |f1 |dist
----------+----------+----------+----
|(0,0) |(0,0) | 0
|(-10,0) |(0,0) | 10
|(-3,4) |(0,0) | 5
|(5.1,34.5)|(0,0) | 34
|(-5,-12) |(0,0) | 13
|(0,0) |(-10,0) | 10
|(-10,0) |(-10,0) | 0
|(-3,4) |(-10,0) | 8
|(5.1,34.5)|(-10,0) | 37
|(-5,-12) |(-10,0) | 13
|(0,0) |(-3,4) | 5
|(-10,0) |(-3,4) | 8
|(-3,4) |(-3,4) | 0
|(5.1,34.5)|(-3,4) | 31
|(-5,-12) |(-3,4) | 16
|(0,0) |(5.1,34.5)| 34
|(-10,0) |(5.1,34.5)| 37
|(-3,4) |(5.1,34.5)| 31
|(5.1,34.5)|(5.1,34.5)| 0
|(-5,-12) |(5.1,34.5)| 47
|(0,0) |(-5,-12) | 13
|(-10,0) |(-5,-12) | 13
|(-3,4) |(-5,-12) | 16
|(5.1,34.5)|(-5,-12) | 47
|(-5,-12) |(-5,-12) | 0
(25 rows)
thirtysix|f1 |f1 | dist
---------+----------+----------+----------------
|(0,0) |(0,0) | 0
|(-10,0) |(0,0) | 10
|(-3,4) |(0,0) | 5
|(5.1,34.5)|(0,0) |34.8749193547455
|(-5,-12) |(0,0) | 13
|(10,10) |(0,0) | 14.142135623731
|(0,0) |(-10,0) | 10
|(-10,0) |(-10,0) | 0
|(-3,4) |(-10,0) |8.06225774829855
|(5.1,34.5)|(-10,0) |37.6597928831267
|(-5,-12) |(-10,0) | 13
|(10,10) |(-10,0) |22.3606797749979
|(0,0) |(-3,4) | 5
|(-10,0) |(-3,4) |8.06225774829855
|(-3,4) |(-3,4) | 0
|(5.1,34.5)|(-3,4) |31.5572495632937
|(-5,-12) |(-3,4) |16.1245154965971
|(10,10) |(-3,4) |14.3178210632764
|(0,0) |(5.1,34.5)|34.8749193547455
|(-10,0) |(5.1,34.5)|37.6597928831267
|(-3,4) |(5.1,34.5)|31.5572495632937
|(5.1,34.5)|(5.1,34.5)| 0
|(-5,-12) |(5.1,34.5)|47.5842410888311
|(10,10) |(5.1,34.5)|24.9851956166046
|(0,0) |(-5,-12) | 13
|(-10,0) |(-5,-12) | 13
|(-3,4) |(-5,-12) |16.1245154965971
|(5.1,34.5)|(-5,-12) |47.5842410888311
|(-5,-12) |(-5,-12) | 0
|(10,10) |(-5,-12) |26.6270539113887
|(0,0) |(10,10) | 14.142135623731
|(-10,0) |(10,10) |22.3606797749979
|(-3,4) |(10,10) |14.3178210632764
|(5.1,34.5)|(10,10) |24.9851956166046
|(-5,-12) |(10,10) |26.6270539113887
|(10,10) |(10,10) | 0
(36 rows)
QUERY: SELECT '' AS t
wen
ty, p1.f1, p2.f1
QUERY: SELECT '' AS t
hir
ty, p1.f1, p2.f1
FROM POINT_TBL p1, POINT_TBL p2
WHERE (p1.f1 <===> p2.f1) > 3;
t
wen
ty|f1 |f1
t
hir
ty|f1 |f1
------+----------+----------
|(-10,0) |(0,0)
|(-3,4) |(0,0)
|(5.1,34.5)|(0,0)
|(-5,-12) |(0,0)
|(10,10) |(0,0)
|(0,0) |(-10,0)
|(-3,4) |(-10,0)
|(5.1,34.5)|(-10,0)
|(-5,-12) |(-10,0)
|(10,10) |(-10,0)
|(0,0) |(-3,4)
|(-10,0) |(-3,4)
|(5.1,34.5)|(-3,4)
|(-5,-12) |(-3,4)
|(10,10) |(-3,4)
|(0,0) |(5.1,34.5)
|(-10,0) |(5.1,34.5)
|(-3,4) |(5.1,34.5)
|(-5,-12) |(5.1,34.5)
|(10,10) |(5.1,34.5)
|(0,0) |(-5,-12)
|(-10,0) |(-5,-12)
|(-3,4) |(-5,-12)
|(5.1,34.5)|(-5,-12)
(20 rows)
|(10,10) |(-5,-12)
|(0,0) |(10,10)
|(-10,0) |(10,10)
|(-3,4) |(10,10)
|(5.1,34.5)|(10,10)
|(-5,-12) |(10,10)
(30 rows)
QUERY: SELECT '' AS
t
en, p1.f1, p2.f1
QUERY: SELECT '' AS
fifte
en, p1.f1, p2.f1
FROM POINT_TBL p1, POINT_TBL p2
WHERE (p1.f1 <===> p2.f1) > 3 and
p1.f1 !< p2.f1;
ten|f1 |f1
---+--------+----------
|(-10,0) |(0,0)
|(-3,4) |(0,0)
|(-5,-12)|(0,0)
|(-10,0) |(-3,4)
|(-5,-12)|(-3,4)
|(0,0) |(5.1,34.5)
|(-10,0) |(5.1,34.5)
|(-3,4) |(5.1,34.5)
|(-5,-12)|(5.1,34.5)
|(-10,0) |(-5,-12)
(10 rows)
fifteen|f1 |f1
-------+----------+----------
|(-10,0) |(0,0)
|(-3,4) |(0,0)
|(-5,-12) |(0,0)
|(-10,0) |(-3,4)
|(-5,-12) |(-3,4)
|(0,0) |(5.1,34.5)
|(-10,0) |(5.1,34.5)
|(-3,4) |(5.1,34.5)
|(-5,-12) |(5.1,34.5)
|(-10,0) |(-5,-12)
|(0,0) |(10,10)
|(-10,0) |(10,10)
|(-3,4) |(10,10)
|(5.1,34.5)|(10,10)
|(-5,-12) |(10,10)
(15 rows)
QUERY: SELECT '' AS t
wo
, p1.f1, p2.f1
QUERY: SELECT '' AS t
hree
, p1.f1, p2.f1
FROM POINT_TBL p1, POINT_TBL p2
WHERE (p1.f1 <===> p2.f1) > 3 and
p1.f1 !< p2.f1 and
p1.f1 !^ p2.f1;
two|f1 |f1
---+-------+--------
|(-3,4) |(0,0)
|(-10,0)|(-5,-12)
(2 rows)
three|f1 |f1
-----+----------+--------
|(-3,4) |(0,0)
|(-10,0) |(-5,-12)
|(5.1,34.5)|(10,10)
(3 rows)
src/test/regress/expected/polygon.out
View file @
df770717
...
...
@@ -14,51 +14,51 @@ WARN:Bad polygon external representation '(0,1,2,3'
QUERY: INSERT INTO POLYGON_TBL(f1) VALUES ('asdf');
WARN:Bad polygon external representation 'asdf'
QUERY: SELECT '' AS four, POLYGON_TBL.*;
four|f1
----+-------------------
------------------------------------------------------------
|(
2, 2, 0, 0, 4, 0
)
|(
3, 3, 1, 1, 3, 0
)
|(
0, 0)
|(
0, 0, 1, 1)
four|f1
----+-------------------
|(
(2,0),(2,4),(0,0)
)
|(
(3,1),(3,3),(1,0)
)
|(
(0,0))
|(
(0,1),(0,1))
(4 rows)
QUERY: SELECT '' AS three, p.*
FROM POLYGON_TBL p
WHERE p.f1 && '(3.0,3.0,1.0,1.0,3.0,0.0)';
three|f1
-----+-------------------------------------------------------------------------------
|( 2, 2, 0, 0, 4, 0)
|( 3, 3, 1, 1, 3, 0)
|( 0, 0, 1, 1)
(3 rows)
three|f1
-----+-------------------
|((2,0),(2,4),(0,0))
|((3,1),(3,3),(1,0))
(2 rows)
QUERY: SELECT '' AS four, p.*
FROM POLYGON_TBL p
WHERE p.f1 &< '(3.0,3.0,1.0,1.0,3.0,0.0)';
four|f1
----+-------------------
------------------------------------------------------------
|(
2, 2, 0, 0, 4, 0
)
|(
3, 3, 1, 1, 3, 0
)
|(
0, 0)
|(
0, 0, 1, 1)
four|f1
----+-------------------
|(
(2,0),(2,4),(0,0)
)
|(
(3,1),(3,3),(1,0)
)
|(
(0,0))
|(
(0,1),(0,1))
(4 rows)
QUERY: SELECT '' AS two, p.*
FROM POLYGON_TBL p
WHERE p.f1 &> '(3.0,3.0,1.0,1.0,3.0,0.0)';
two|f1
---+-------------------
------------------------------------------------------------
|(
2, 2, 0, 0, 4, 0
)
|(
3, 3, 1, 1, 3, 0
)
two|f1
---+-------------------
|(
(2,0),(2,4),(0,0)
)
|(
(3,1),(3,3),(1,0)
)
(2 rows)
QUERY: SELECT '' AS one, p.*
FROM POLYGON_TBL p
WHERE p.f1 << '(3.0,3.0,1.0,1.0,3.0,0.0)';
one|f1
---+---------------------------
|( 0, 0)
(1 row)
one|f1
---+-------------
|((0,0))
|((0,1),(0,1))
(2 rows)
QUERY: SELECT '' AS zero, p.*
FROM POLYGON_TBL p
...
...
@@ -70,25 +70,25 @@ zero|f1
QUERY: SELECT '' AS one, p.*
FROM POLYGON_TBL p
WHERE p.f1 @ '(3.0,3.0,1.0,1.0,3.0,0.0)';
one|f1
---+-------------------
------------------------------------------------------------
|(
3, 3, 1, 1, 3, 0
)
one|f1
---+-------------------
|(
(3,1),(3,3),(1,0)
)
(1 row)
QUERY: SELECT '' AS one, p.*
FROM POLYGON_TBL p
WHERE p.f1 ~= '(3.0,3.0,1.0,1.0,3.0,0.0)';
one|f1
---+-------------------
------------------------------------------------------------
|(
3, 3, 1, 1, 3, 0
)
one|f1
---+-------------------
|(
(3,1),(3,3),(1,0)
)
(1 row)
QUERY: SELECT '' AS one, p.*
FROM POLYGON_TBL p
WHERE p.f1 ~ '(3.0,3.0,1.0,1.0,3.0,0.0)';
one|f1
---+-------------------
------------------------------------------------------------
|(
3, 3, 1, 1, 3, 0
)
one|f1
---+-------------------
|(
(3,1),(3,3),(1,0)
)
(1 row)
QUERY: SELECT '(2.0,2.0,0.0,0.0,4.0,0.0)'::polygon << '(3.0,3.0,1.0,1.0,3.0,0.0)'::polygon AS false;
...
...
src/test/regress/expected/select.out
View file @
df770717
=============== running regression queries ... =================
QUERY: SELECT onek.* WHERE onek.unique1 < 10;
unique1|unique2|two|four|ten|twenty|hundred|thousand|twothousand|fivethous|tenthous|odd|even|stringu1|stringu2|string4
-------+-------+---+----+---+------+-------+--------+-----------+---------+--------+---+----+--------+--------+-------
...
...
@@ -176,7 +175,6 @@ unique1|string4
QUERY: SELECT two, stringu1, ten, string4
INTO TABLE temp
FROM onek;
QUERY: SELECT p.name, p.age FROM person* p;
name |age
-------+---
...
...
src/test/regress/expected/tinterval.out
View file @
df770717
This diff is collapsed.
Click to expand it.
src/test/regress/input/Makefile
View file @
df770717
...
...
@@ -7,7 +7,7 @@
#
#
# IDENTIFICATION
# $Header: /cvsroot/pgsql/src/test/regress/input/Attic/Makefile,v 1.
3 1997/04/26 05:44:38
scrappy Exp $
# $Header: /cvsroot/pgsql/src/test/regress/input/Attic/Makefile,v 1.
4 1997/04/27 02:58:15
scrappy Exp $
#
#-------------------------------------------------------------------------
...
...
@@ -20,7 +20,8 @@ include ../../../Makefile.global
# INFILES is the files the regression test uses for input.
INFILES
=
copy.sql
\
create_function_1.sql
\
create_function_2.sql
create_function_2.sql
\
misc.sql
all
:
$(INFILES)
...
...
src/test/regress/output/create_function_1.source
View file @
df770717
QUERY: CREATE FUNCTION
circle
_in(opaque)
RETURNS
circle
QUERY: CREATE FUNCTION
widget
_in(opaque)
RETURNS
widget
AS '_CWD_/regress_DLSUFFIX_'
LANGUAGE 'c';
NOTICE:ProcedureCreate: type '
circle
' is not yet defined
QUERY: CREATE FUNCTION
circle
_out(opaque)
NOTICE:ProcedureCreate: type '
widget
' is not yet defined
QUERY: CREATE FUNCTION
widget
_out(opaque)
RETURNS opaque
AS '_CWD_/regress_DLSUFFIX_'
LANGUAGE 'c';
src/test/regress/output/create_function_2.source
View file @
df770717
...
...
@@ -17,7 +17,7 @@ QUERY: CREATE FUNCTION user_relns()
where relname !~ ''pg_.*'' and
relkind <> ''i'' '
LANGUAGE 'sql';
QUERY: CREATE FUNCTION pt_in_
circle(point, circle
)
QUERY: CREATE FUNCTION pt_in_
widget(point, widget
)
RETURNS int4
AS '_CWD_/regress_DLSUFFIX_'
LANGUAGE 'c';
...
...
src/test/regress/regress.sh
View file @
df770717
#!/bin/sh
# $Header: /cvsroot/pgsql/src/test/regress/Attic/regress.sh,v 1.
7 1997/04/26 05:49:39
scrappy Exp $
# $Header: /cvsroot/pgsql/src/test/regress/Attic/regress.sh,v 1.
8 1997/04/27 02:56:18
scrappy Exp $
#
if
[
-d
./obj
]
;
then
cd
./obj
...
...
@@ -10,26 +10,27 @@ TZ="PST8PDT7,M04.01.00,M10.05.03"; export TZ
#FRONTEND=monitor
FRONTEND
=
"psql -n -e -q"
echo
===============
Notes...
=================
echo
"
You must be already running the postmaster
"
echo
"
for the regression tests to succeed.
"
echo
"
The time zone might need to be set to PST/PDT
"
echo
"
for the date and time data types to pass the
"
echo
" regression tests; to do this type"
echo
"=============== Notes... ================="
echo
"
postmaster must already be running for the regression tests to succeed.
"
echo
"
The non-GEQ optimizer will give more consistant results than will the
"
echo
"
GEQ optimizer. See the regression testing README for more details.
"
echo
"
The time zone might need to be set to PST/PDT for the date and time data
"
echo
"
types to pass the
regression tests; to do this type"
echo
" setenv TZ
$TZ
"
echo
" before starting the postmaster."
echo
""
echo
===============
destroying old regression database...
=================
echo
"=============== destroying old regression database... ================="
destroydb regression
echo
===============
creating new regression database...
=================
echo
"=============== creating new regression database... ================="
createdb regression
if
[
$?
-ne
0
]
;
then
echo
createdb failed
exit
1
fi
echo
===============
running regression queries ...
=================
echo
"=============== running regression queries... ================="
for
i
in
`
cat
sql/tests
`
do
echo
-n
"
${
i
}
.. "
...
...
@@ -43,7 +44,7 @@ do
done
exit
echo
===============
running error queries ...
=================
echo
"=============== running error queries ... ================="
$FRONTEND
regression < errors.sql
# this will generate error result code
...
...
@@ -54,7 +55,7 @@ if test "$debug" -eq 1
then
echo
Skipping clearing and deletion of the regression database
else
echo
===============
clearing regression database...
=================
echo
"=============== clearing regression database... ================="
$FRONTEND
regression < destroy.sql
if
[
$?
-ne
0
]
;
then
echo
the destroy script has an error
...
...
@@ -62,7 +63,7 @@ if [ $? -ne 0 ]; then
fi
exit
0
echo
===============
destroying regression database...
=================
echo
"=============== destroying regression database... ================="
destroydb regression
if
[
$?
-ne
0
]
;
then
echo
destroydb failed
...
...
src/test/regress/sql/Makefile
View file @
df770717
...
...
@@ -7,11 +7,11 @@
#
#
# IDENTIFICATION
# $Header: /cvsroot/pgsql/src/test/regress/sql/Attic/Makefile,v 1.
1 1997/04/26 05:45:48
scrappy Exp $
# $Header: /cvsroot/pgsql/src/test/regress/sql/Attic/Makefile,v 1.
2 1997/04/27 02:58:26
scrappy Exp $
#
#-------------------------------------------------------------------------
CLFILES
=
create_function_1.sql create_function_2.sql copy.sql
CLFILES
=
create_function_1.sql create_function_2.sql copy.sql
misc.sql
clean
:
rm
-f
$(CLFILES)
src/test/regress/sql/abstime.sql
View file @
df770717
...
...
@@ -3,7 +3,7 @@
--
-- timezones may vary based not only on location but the operating
-- system. the main correctness issue is that the OS may not get
--
DST right for times prior to u
nix epoch (jan 1 1970).
--
daylight savings time right for times prior to U
nix epoch (jan 1 1970).
--
CREATE
TABLE
ABSTIME_TBL
(
f1
abstime
);
...
...
@@ -37,51 +37,51 @@ INSERT INTO ABSTIME_TBL (f1) VALUES ('Jun 10, 1843');
-- test abstime operators
SELECT
''
AS
e
leven
,
ABSTIME_TBL
.
*
;
SELECT
''
AS
e
ight
,
ABSTIME_TBL
.
*
;
SELECT
''
AS
eight
,
ABSTIME_TBL
.
*
SELECT
''
AS
six
,
ABSTIME_TBL
.
*
WHERE
ABSTIME_TBL
.
f1
<
'Jun 30, 2001'
::
abstime
;
SELECT
''
AS
eight
,
ABSTIME_TBL
.
*
SELECT
''
AS
six
,
ABSTIME_TBL
.
*
WHERE
ABSTIME_TBL
.
f1
>
'-infinity'
::
abstime
;
SELECT
''
AS
eight
,
ABSTIME_TBL
.
*
SELECT
''
AS
six
,
ABSTIME_TBL
.
*
WHERE
'May 10, 1943 23:59:12'
::
abstime
<>
ABSTIME_TBL
.
f1
;
SELECT
''
AS
one
,
ABSTIME_TBL
.
*
WHERE
'current'
::
abstime
=
ABSTIME_TBL
.
f1
;
SELECT
''
AS
fiv
e
,
ABSTIME_TBL
.
*
SELECT
''
AS
thre
e
,
ABSTIME_TBL
.
*
WHERE
'epoch'
::
abstime
>=
ABSTIME_TBL
.
f1
;
SELECT
''
AS
six
,
ABSTIME_TBL
.
*
SELECT
''
AS
four
,
ABSTIME_TBL
.
*
WHERE
ABSTIME_TBL
.
f1
<=
'Jan 14, 1973 03:14:21'
::
abstime
;
SELECT
''
AS
six
,
ABSTIME_TBL
.
*
SELECT
''
AS
four
,
ABSTIME_TBL
.
*
WHERE
ABSTIME_TBL
.
f1
<?>
'["Apr 1 1945 00:00:00" "Dec 30 1999 23:00:00"]'
::
tinterval
;
-- these four queries should return the same answer
-- the "infinity" and "-infinity" tuples in ABSTIME_TBL cannot be added and
-- therefore, should not show up in the results.
SELECT
''
AS
fiv
e
,
ABSTIME_TBL
.
*
SELECT
''
AS
thre
e
,
ABSTIME_TBL
.
*
WHERE
(
ABSTIME_TBL
.
f1
+
'@ 3 year'
::
reltime
)
-- +3 years
<
'Jan 14 14:00:00 1977'
::
abstime
;
SELECT
''
AS
fiv
e
,
ABSTIME_TBL
.
*
SELECT
''
AS
thre
e
,
ABSTIME_TBL
.
*
WHERE
(
ABSTIME_TBL
.
f1
+
'@ 3 year ago'
::
reltime
)
-- -3 years
<
'Jan 14 14:00:00 1971'
::
abstime
;
SELECT
''
AS
fiv
e
,
ABSTIME_TBL
.
*
SELECT
''
AS
thre
e
,
ABSTIME_TBL
.
*
WHERE
(
ABSTIME_TBL
.
f1
-
'@ 3 year'
::
reltime
)
-- -(+3) years
<
'Jan 14 14:00:00 1971'
::
abstime
;
SELECT
''
AS
fiv
e
,
ABSTIME_TBL
.
*
SELECT
''
AS
thre
e
,
ABSTIME_TBL
.
*
WHERE
(
ABSTIME_TBL
.
f1
-
'@ 3 year ago'
::
reltime
)
-- -(-3) years
<
'Jan 14 14:00:00 1977'
::
abstime
;
SELECT
''
AS
t
wenty
,
ABSTIME_TBL
.
*
,
RELTIME_TBL
.
*
SELECT
''
AS
t
en
,
ABSTIME_TBL
.
*
,
RELTIME_TBL
.
*
WHERE
(
ABSTIME_TBL
.
f1
+
RELTIME_TBL
.
f1
)
<
'Jan 14 14:00:00 1971'
::
abstime
;
src/test/regress/sql/point.sql
View file @
df770717
...
...
@@ -22,7 +22,7 @@ INSERT INTO POINT_TBL(f1) VALUES ('(10.0 10.0)');
INSERT
INTO
POINT_TBL
(
f1
)
VALUES
(
'(10.0,10.0'
);
SELECT
''
AS
five
,
POINT_TBL
.
*
;
SELECT
''
AS
six
,
POINT_TBL
.
*
;
-- left of
SELECT
''
AS
three
,
p
.
*
FROM
POINT_TBL
p
WHERE
p
.
f1
!<
'(0.0, 0.0)'
;
...
...
@@ -40,7 +40,7 @@ SELECT '' AS one, p.* FROM POINT_TBL p WHERE p.f1 !| '(0.0, 0.0)';
SELECT
''
AS
one
,
p
.
*
FROM
POINT_TBL
p
WHERE
p
.
f1
=|=
'(5.1, 34.5)'
;
-- point in box
SELECT
''
AS
t
wo
,
p
.
*
FROM
POINT_TBL
p
SELECT
''
AS
t
hree
,
p
.
*
FROM
POINT_TBL
p
WHERE
p
.
f1
===>
'(0,0,100,100)'
;
SELECT
''
AS
three
,
p
.
*
FROM
POINT_TBL
p
...
...
@@ -49,24 +49,23 @@ SELECT '' AS three, p.* FROM POINT_TBL p
SELECT
''
AS
two
,
p
.
*
FROM
POINT_TBL
p
WHERE
on_ppath
(
p
.
f1
,
'(0,3,0,0,-10,0,-10,10)'
::
path
);
SELECT
''
AS
five
,
p
.
f1
,
p
.
f1
<===>
'(0,0)'
AS
dist
FROM
POINT_TBL
p
;
SELECT
''
AS
six
,
p
.
f1
,
p
.
f1
<===>
'(0,0)'
::
point
AS
dist
FROM
POINT_TBL
p
;
SELECT
''
AS
t
wentyfive
,
p1
.
f1
,
p2
.
f1
,
p1
.
f1
<===>
p2
.
f1
AS
dist
SELECT
''
AS
t
hirtysix
,
p1
.
f1
,
p2
.
f1
,
p1
.
f1
<===>
p2
.
f1
AS
dist
FROM
POINT_TBL
p1
,
POINT_TBL
p2
;
SELECT
''
AS
t
wen
ty
,
p1
.
f1
,
p2
.
f1
SELECT
''
AS
t
hir
ty
,
p1
.
f1
,
p2
.
f1
FROM
POINT_TBL
p1
,
POINT_TBL
p2
WHERE
(
p1
.
f1
<===>
p2
.
f1
)
>
3
;
SELECT
''
AS
t
en
,
p1
.
f1
,
p2
.
f1
SELECT
''
AS
fifte
en
,
p1
.
f1
,
p2
.
f1
FROM
POINT_TBL
p1
,
POINT_TBL
p2
WHERE
(
p1
.
f1
<===>
p2
.
f1
)
>
3
and
p1
.
f1
!<
p2
.
f1
;
SELECT
''
AS
t
wo
,
p1
.
f1
,
p2
.
f1
SELECT
''
AS
t
hree
,
p1
.
f1
,
p2
.
f1
FROM
POINT_TBL
p1
,
POINT_TBL
p2
WHERE
(
p1
.
f1
<===>
p2
.
f1
)
>
3
and
p1
.
f1
!<
p2
.
f1
and
p1
.
f1
!^
p2
.
f1
;
src/test/regress/sql/tests
View file @
df770717
...
...
@@ -9,6 +9,8 @@ create_operator
create_view
create_index
sanity_check
timespan
datetime
reltime
abstime
boolean
...
...
@@ -34,4 +36,5 @@ select
select_into
select_distinct
select_distinct_on
errors
misc
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