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
04688df6
Commit
04688df6
authored
Apr 05, 1997
by
Marc G. Fournier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Again, add more tests
parent
7956e606
Changes
15
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
2040 additions
and
2 deletions
+2040
-2
src/test/regress/sql/char16.sql
src/test/regress/sql/char16.sql
+45
-0
src/test/regress/sql/char8.sql
src/test/regress/sql/char8.sql
+46
-0
src/test/regress/sql/float4.sql
src/test/regress/sql/float4.sql
+65
-0
src/test/regress/sql/float8.sql
src/test/regress/sql/float8.sql
+104
-0
src/test/regress/sql/int2.sql
src/test/regress/sql/int2.sql
+77
-0
src/test/regress/sql/int4.sql
src/test/regress/sql/int4.sql
+105
-0
src/test/regress/sql/misc.sql
src/test/regress/sql/misc.sql
+1212
-0
src/test/regress/sql/oid.sql
src/test/regress/sql/oid.sql
+32
-0
src/test/regress/sql/oidint2.sql
src/test/regress/sql/oidint2.sql
+47
-0
src/test/regress/sql/oidint4.sql
src/test/regress/sql/oidint4.sql
+46
-0
src/test/regress/sql/oidname.sql
src/test/regress/sql/oidname.sql
+39
-0
src/test/regress/sql/point.sql
src/test/regress/sql/point.sql
+72
-0
src/test/regress/sql/polygon.sql
src/test/regress/sql/polygon.sql
+117
-0
src/test/regress/sql/tests
src/test/regress/sql/tests
+16
-2
src/test/regress/sql/text.sql
src/test/regress/sql/text.sql
+17
-0
No files found.
src/test/regress/sql/char16.sql
0 → 100644
View file @
04688df6
--**************** testing built-in type char16 **************
--
-- all inputs are silently truncated at 16 characters
--
CREATE
TABLE
CHAR16_TBL
(
f1
char16
);
INSERT
INTO
CHAR16_TBL
(
f1
)
VALUES
(
'ABCDEFGHIJKLMNOP'
);
INSERT
INTO
CHAR16_TBL
(
f1
)
VALUES
(
'abcdefghijklmnop'
);
INSERT
INTO
CHAR16_TBL
(
f1
)
VALUES
(
'asdfghjkl;'
);
INSERT
INTO
CHAR16_TBL
(
f1
)
VALUES
(
'343f%2a'
);
INSERT
INTO
CHAR16_TBL
(
f1
)
VALUES
(
'd34aaasdf'
);
INSERT
INTO
CHAR16_TBL
(
f1
)
VALUES
(
''
);
INSERT
INTO
CHAR16_TBL
(
f1
)
VALUES
(
'1234567890ABCDEFGHIJKLMNOPQRSTUV'
);
SELECT
''
AS
seven
,
CHAR16_TBL
.
*
;
SELECT
''
AS
six
,
c
.
f1
FROM
CHAR16_TBL
c
WHERE
c
.
f1
<>
'ABCDEFGHIJKLMNOP'
;
SELECT
''
AS
one
,
c
.
f1
FROM
CHAR16_TBL
c
WHERE
c
.
f1
=
'ABCDEFGHIJKLMNOP'
;
SELECT
''
AS
three
,
c
.
f1
FROM
CHAR16_TBL
c
WHERE
c
.
f1
<
'ABCDEFGHIJKLMNOP'
;
SELECT
''
AS
four
,
c
.
f1
FROM
CHAR16_TBL
c
WHERE
c
.
f1
<=
'ABCDEFGHIJKLMNOP'
;
SELECT
''
AS
three
,
c
.
f1
FROM
CHAR16_TBL
c
WHERE
c
.
f1
>
'ABCDEFGHIJKLMNOP'
;
SELECT
''
AS
four
,
c
.
f1
FROM
CHAR16_TBL
c
WHERE
c
.
f1
>=
'ABCDEFGHIJKLMNOP'
;
SELECT
''
AS
seven
,
c
.
f1
FROM
CHAR16_TBL
c
WHERE
c
.
f1
~
'.*'
;
SELECT
''
AS
zero
,
c
.
f1
FROM
CHAR16_TBL
c
WHERE
c
.
f1
!~
'.*'
;
SELECT
''
AS
three
,
c
.
f1
FROM
CHAR16_TBL
c
WHERE
c
.
f1
~
'[0-9]'
;
SELECT
''
AS
two
,
c
.
f1
FROM
CHAR16_TBL
c
WHERE
c
.
f1
~
'.*asdf.*'
;
src/test/regress/sql/char8.sql
0 → 100644
View file @
04688df6
-- **************** testing built-in type char8 **************
--
-- all inputs are silently truncated at 8 characters
--
CREATE
TABLE
CHAR8_TBL
(
f1
char8
);
INSERT
INTO
CHAR8_TBL
(
f1
)
VALUES
(
'ABCDEFGH'
);
INSERT
INTO
CHAR8_TBL
(
f1
)
VALUES
(
'abcdefgh'
);
INSERT
INTO
CHAR8_TBL
(
f1
)
VALUES
(
'ZYWZ410-'
);
INSERT
INTO
CHAR8_TBL
(
f1
)
VALUES
(
'343f%2a'
);
INSERT
INTO
CHAR8_TBL
(
f1
)
VALUES
(
'd34aas'
);
INSERT
INTO
CHAR8_TBL
(
f1
)
VALUES
(
''
);
INSERT
INTO
CHAR8_TBL
(
f1
)
VALUES
(
'1234567890'
);
SELECT
''
AS
seven
,
CHAR8_TBL
.
*
;
SELECT
''
AS
six
,
c
.
f1
FROM
CHAR8_TBL
c
WHERE
c
.
f1
<>
'ABCDEFGH'
;
SELECT
''
AS
one
,
c
.
f1
FROM
CHAR8_TBL
c
WHERE
c
.
f1
=
'ABCDEFGH'
;
SELECT
''
AS
three
,
c
.
f1
FROM
CHAR8_TBL
c
WHERE
c
.
f1
<
'ABCDEFGH'
;
SELECT
''
AS
four
,
c
.
f1
FROM
CHAR8_TBL
c
WHERE
c
.
f1
<=
'ABCDEFGH'
;
SELECT
''
AS
three
,
c
.
f1
FROM
CHAR8_TBL
c
WHERE
c
.
f1
>
'ABCDEFGH'
;
SELECT
''
AS
four
,
c
.
f1
FROM
CHAR8_TBL
c
WHERE
c
.
f1
>=
'ABCDEFGH'
;
SELECT
''
AS
seven
,
c
.
f1
FROM
CHAR8_TBL
c
WHERE
c
.
f1
~
'.*'
;
SELECT
''
AS
zero
,
c
.
f1
FROM
CHAR8_TBL
c
WHERE
c
.
f1
!~
'.*'
;
SELECT
''
AS
four
,
c
.
f1
FROM
CHAR8_TBL
c
WHERE
c
.
f1
~
'[0-9]'
;
SELECT
''
AS
three
,
c
.
f1
FROM
CHAR8_TBL
c
WHERE
c
.
f1
~
'.*34.*'
;
src/test/regress/sql/float4.sql
0 → 100644
View file @
04688df6
-- *************testing built-in type float4 ****************
CREATE
TABLE
FLOAT4_TBL
(
f1
float4
);
INSERT
INTO
FLOAT4_TBL
(
f1
)
VALUES
(
'0.0'
);
INSERT
INTO
FLOAT4_TBL
(
f1
)
VALUES
(
'1004.30'
);
INSERT
INTO
FLOAT4_TBL
(
f1
)
VALUES
(
'-34.84'
);
INSERT
INTO
FLOAT4_TBL
(
f1
)
VALUES
(
'1.2345678901234e+20'
);
INSERT
INTO
FLOAT4_TBL
(
f1
)
VALUES
(
'1.2345678901234e-20'
);
-- test for over and under flow
INSERT
INTO
FLOAT4_TBL
(
f1
)
VALUES
(
'10e40'
);
INSERT
INTO
FLOAT4_TBL
(
f1
)
VALUES
(
'-10e40'
);
INSERT
INTO
FLOAT4_TBL
(
f1
)
VALUES
(
'10e-40'
);
INSERT
INTO
FLOAT4_TBL
(
f1
)
VALUES
(
'-10e-40'
);
SELECT
''
AS
five
,
FLOAT4_TBL
.
*
;
SELECT
''
AS
four
,
f
.
*
FROM
FLOAT4_TBL
f
WHERE
f
.
f1
<>
'1004.3'
;
SELECT
''
AS
one
,
f
.
*
FROM
FLOAT4_TBL
f
WHERE
f
.
f1
=
'1004.3'
;
SELECT
''
AS
three
,
f
.
*
FROM
FLOAT4_TBL
f
WHERE
'1004.3'
>
f
.
f1
;
SELECT
''
AS
three
,
f
.
*
FROM
FLOAT4_TBL
f
WHERE
f
.
f1
<
'1004.3'
;
SELECT
''
AS
four
,
f
.
*
FROM
FLOAT4_TBL
f
WHERE
'1004.3'
>=
f
.
f1
;
SELECT
''
AS
four
,
f
.
*
FROM
FLOAT4_TBL
f
WHERE
f
.
f1
<=
'1004.3'
;
SELECT
''
AS
three
,
f
.
f1
,
f
.
f1
*
'-10'
AS
x
FROM
FLOAT4_TBL
f
WHERE
f
.
f1
>
'0.0'
;
SELECT
''
AS
three
,
f
.
f1
,
f
.
f1
+
'-10'
AS
x
FROM
FLOAT4_TBL
f
WHERE
f
.
f1
>
'0.0'
;
SELECT
''
AS
three
,
f
.
f1
,
f
.
f1
/
'-10'
AS
x
FROM
FLOAT4_TBL
f
WHERE
f
.
f1
>
'0.0'
;
SELECT
''
AS
three
,
f
.
f1
,
f
.
f1
-
'-10'
AS
x
FROM
FLOAT4_TBL
f
WHERE
f
.
f1
>
'0.0'
;
-- test divide by zero
SELECT
''
AS
bad
,
f
.
f1
/
'0.0'
from
FLOAT4_TBL
f
;
SELECT
''
AS
five
,
FLOAT4_TBL
.
*
;
-- test the unary float4abs operator
SELECT
''
AS
five
,
f
.
f1
,
@
f
.
f1
AS
abs_f1
FROM
FLOAT4_TBL
f
;
UPDATE
FLOAT4_TBL
SET
f1
=
FLOAT4_TBL
.
f1
*
'-1'
WHERE
FLOAT4_TBL
.
f1
>
'0.0'
;
SELECT
''
AS
five
,
FLOAT4_TBL
.
*
;
src/test/regress/sql/float8.sql
0 → 100644
View file @
04688df6
-- *************testing built-in type float8 ****************
CREATE
TABLE
FLOAT8_TBL
(
f1
float8
);
INSERT
INTO
FLOAT8_TBL
(
f1
)
VALUES
(
'0.0'
);
INSERT
INTO
FLOAT8_TBL
(
f1
)
VALUES
(
'1004.30'
);
INSERT
INTO
FLOAT8_TBL
(
f1
)
VALUES
(
'-34.84'
);
INSERT
INTO
FLOAT8_TBL
(
f1
)
VALUES
(
'1.2345678901234e+200'
);
INSERT
INTO
FLOAT8_TBL
(
f1
)
VALUES
(
'1.2345678901234e-200'
);
-- test for over and under flow
INSERT
INTO
FLOAT8_TBL
(
f1
)
VALUES
(
'10e400'
);
INSERT
INTO
FLOAT8_TBL
(
f1
)
VALUES
(
'-10e400'
);
INSERT
INTO
FLOAT8_TBL
(
f1
)
VALUES
(
'10e-400'
);
INSERT
INTO
FLOAT8_TBL
(
f1
)
VALUES
(
'-10e-400'
);
SELECT
''
AS
five
,
FLOAT8_TBL
.
*
;
SELECT
''
AS
four
,
f
.
*
FROM
FLOAT8_TBL
f
WHERE
f
.
f1
<>
'1004.3'
;
SELECT
''
AS
one
,
f
.
*
FROM
FLOAT8_TBL
f
WHERE
f
.
f1
=
'1004.3'
;
SELECT
''
AS
three
,
f
.
*
FROM
FLOAT8_TBL
f
WHERE
'1004.3'
>
f
.
f1
;
SELECT
''
AS
three
,
f
.
*
FROM
FLOAT8_TBL
f
WHERE
f
.
f1
<
'1004.3'
;
SELECT
''
AS
four
,
f
.
*
FROM
FLOAT8_TBL
f
WHERE
'1004.3'
>=
f
.
f1
;
SELECT
''
AS
four
,
f
.
*
FROM
FLOAT8_TBL
f
WHERE
f
.
f1
<=
'1004.3'
;
SELECT
''
AS
three
,
f
.
f1
,
f
.
f1
*
'-10'
AS
x
FROM
FLOAT8_TBL
f
WHERE
f
.
f1
>
'0.0'
;
SELECT
''
AS
three
,
f
.
f1
,
f
.
f1
+
'-10'
AS
x
FROM
FLOAT8_TBL
f
WHERE
f
.
f1
>
'0.0'
;
SELECT
''
AS
three
,
f
.
f1
,
f
.
f1
/
'-10'
AS
x
FROM
FLOAT8_TBL
f
WHERE
f
.
f1
>
'0.0'
;
SELECT
''
AS
three
,
f
.
f1
,
f
.
f1
-
'-10'
AS
x
FROM
FLOAT8_TBL
f
WHERE
f
.
f1
>
'0.0'
;
SELECT
''
AS
one
,
f
.
f1
^
'2.0'
AS
square_f1
FROM
FLOAT8_TBL
f
where
f
.
f1
=
'1004.3'
;
-- absolute value
SELECT
''
AS
five
,
f
.
f1
,
@
f
.
f1
AS
abs_f1
FROM
FLOAT8_TBL
f
;
-- truncate
SELECT
''
AS
five
,
f
.
f1
,
%
f
.
f1
AS
trunc_f1
FROM
FLOAT8_TBL
f
;
-- round
SELECT
''
AS
five
,
f
.
f1
,
f
.
f1
%
AS
round_f1
FROM
FLOAT8_TBL
f
;
-- square root
SELECT
''
AS
three
,
f
.
f1
,
|/
f
.
f1
AS
sqrt_f1
FROM
FLOAT8_TBL
f
WHERE
f
.
f1
>
'0.0'
;
-- take exp of ln(f.f1)
SELECT
''
AS
three
,
f
.
f1
,
:
(
;
f
.
f1
)
AS
exp_ln_f1
FROM
FLOAT8_TBL
f
WHERE
f
.
f1
>
'0.0'
;
-- cube root
SELECT
''
AS
five
,
f
.
f1
,
||/
f
.
f1
AS
cbrt_f1
FROM
FLOAT8_TBL
f
;
SELECT
''
AS
five
,
FLOAT8_TBL
.
*
;
UPDATE
FLOAT8_TBL
SET
f1
=
FLOAT8_TBL
.
f1
*
'-1'
WHERE
FLOAT8_TBL
.
f1
>
'0.0'
;
SELECT
''
AS
bad
,
f
.
f1
*
'1e200'
from
FLOAT8_TBL
f
;
SELECT
''
AS
bad
,
f
.
f1
^
'1e200'
from
FLOAT8_TBL
f
;
SELECT
''
AS
bad
,
(;
(
f
.
f1
))
from
FLOAT8_TBL
f
where
f
.
f1
=
'0.0'
;
SELECT
''
AS
bad
,
(;
(
f
.
f1
))
from
FLOAT8_TBL
f
where
f
.
f1
<
'0.0'
;
SELECT
''
AS
bad
,
:
(
f
.
f1
)
from
FLOAT8_TBL
f
;
SELECT
''
AS
bad
,
f
.
f1
/
'0.0'
from
FLOAT8_TBL
f
;
SELECT
''
AS
five
,
FLOAT8_TBL
.
*
;
src/test/regress/sql/int2.sql
0 → 100644
View file @
04688df6
-- *************testing built-in type int2 ****************
--
-- NOTE: int2 operators never check for over/underflow!
-- Some of these answers are consequently numerically incorrect.
--
CREATE
TABLE
INT2_TBL
(
f1
int2
);
INSERT
INTO
INT2_TBL
(
f1
)
VALUES
(
'0'
);
INSERT
INTO
INT2_TBL
(
f1
)
VALUES
(
'1234'
);
INSERT
INTO
INT2_TBL
(
f1
)
VALUES
(
'-1234'
);
INSERT
INTO
INT2_TBL
(
f1
)
VALUES
(
'34.5'
);
-- largest and smallest values
INSERT
INTO
INT2_TBL
(
f1
)
VALUES
(
'32767'
);
INSERT
INTO
INT2_TBL
(
f1
)
VALUES
(
'-32767'
);
-- bad input values -- should give warnings
INSERT
INTO
INT2_TBL
(
f1
)
VALUES
(
'100000'
);
INSERT
INTO
INT2_TBL
(
f1
)
VALUES
(
'asdf'
);
SELECT
''
AS
five
,
INT2_TBL
.
*
;
SELECT
''
AS
four
,
i
.
*
FROM
INT2_TBL
i
WHERE
i
.
f1
<>
'0'
::
int2
;
SELECT
''
AS
four
,
i
.
*
FROM
INT2_TBL
i
WHERE
i
.
f1
<>
'0'
::
int4
;
SELECT
''
AS
one
,
i
.
*
FROM
INT2_TBL
i
WHERE
i
.
f1
=
'0'
::
int2
;
SELECT
''
AS
one
,
i
.
*
FROM
INT2_TBL
i
WHERE
i
.
f1
=
'0'
::
int4
;
SELECT
''
AS
two
,
i
.
*
FROM
INT2_TBL
i
WHERE
i
.
f1
<
'0'
::
int2
;
SELECT
''
AS
two
,
i
.
*
FROM
INT2_TBL
i
WHERE
i
.
f1
<
'0'
::
int4
;
SELECT
''
AS
three
,
i
.
*
FROM
INT2_TBL
i
WHERE
i
.
f1
<=
'0'
::
int2
;
SELECT
''
AS
three
,
i
.
*
FROM
INT2_TBL
i
WHERE
i
.
f1
<=
'0'
::
int4
;
SELECT
''
AS
two
,
i
.
*
FROM
INT2_TBL
i
WHERE
i
.
f1
>
'0'
::
int2
;
SELECT
''
AS
two
,
i
.
*
FROM
INT2_TBL
i
WHERE
i
.
f1
>
'0'
::
int4
;
SELECT
''
AS
three
,
i
.
*
FROM
INT2_TBL
i
WHERE
i
.
f1
>=
'0'
::
int2
;
SELECT
''
AS
three
,
i
.
*
FROM
INT2_TBL
i
WHERE
i
.
f1
>=
'0'
::
int4
;
-- positive odds
SELECT
''
AS
one
,
i
.
*
FROM
INT2_TBL
i
WHERE
(
i
.
f1
%
'2'
::
int2
)
=
'1'
::
int2
;
-- any evens
SELECT
''
AS
three
,
i
.
*
FROM
INT2_TBL
i
WHERE
(
i
.
f1
%
'2'
::
int4
)
=
'0'
::
int2
;
SELECT
''
AS
five
,
i
.
f1
,
i
.
f1
*
'2'
::
int2
AS
x
FROM
INT2_TBL
i
;
SELECT
''
AS
five
,
i
.
f1
,
i
.
f1
*
'2'
::
int4
AS
x
FROM
INT2_TBL
i
;
SELECT
''
AS
five
,
i
.
f1
,
i
.
f1
+
'2'
::
int2
AS
x
FROM
INT2_TBL
i
;
SELECT
''
AS
five
,
i
.
f1
,
i
.
f1
+
'2'
::
int4
AS
x
FROM
INT2_TBL
i
;
SELECT
''
AS
five
,
i
.
f1
,
i
.
f1
-
'2'
::
int2
AS
x
FROM
INT2_TBL
i
;
SELECT
''
AS
five
,
i
.
f1
,
i
.
f1
-
'2'
::
int4
AS
x
FROM
INT2_TBL
i
;
SELECT
''
AS
five
,
i
.
f1
,
i
.
f1
/
'2'
::
int2
AS
x
FROM
INT2_TBL
i
;
SELECT
''
AS
five
,
i
.
f1
,
i
.
f1
/
'2'
::
int4
AS
x
FROM
INT2_TBL
i
;
src/test/regress/sql/int4.sql
0 → 100644
View file @
04688df6
-- *************testing built-in type int4 ****************
--
-- WARNING: int4 operators never check for over/underflow!
-- Some of these answers are consequently numerically incorrect.
--
CREATE
TABLE
INT4_TBL
(
f1
int4
);
INSERT
INTO
INT4_TBL
(
f1
)
VALUES
(
'0'
);
INSERT
INTO
INT4_TBL
(
f1
)
VALUES
(
'123456'
);
INSERT
INTO
INT4_TBL
(
f1
)
VALUES
(
'-123456'
);
INSERT
INTO
INT4_TBL
(
f1
)
VALUES
(
'34.5'
);
-- largest and smallest values
INSERT
INTO
INT4_TBL
(
f1
)
VALUES
(
'2147483647'
);
INSERT
INTO
INT4_TBL
(
f1
)
VALUES
(
'-2147483647'
);
-- bad input values -- should give warnings
INSERT
INTO
INT4_TBL
(
f1
)
VALUES
(
'1000000000000'
);
INSERT
INTO
INT4_TBL
(
f1
)
VALUES
(
'asdf'
);
SELECT
''
AS
five
,
INT4_TBL
.
*
;
SELECT
''
AS
four
,
i
.
*
FROM
INT4_TBL
i
WHERE
i
.
f1
<>
'0'
::
int2
;
SELECT
''
AS
four
,
i
.
*
FROM
INT4_TBL
i
WHERE
i
.
f1
<>
'0'
::
int4
;
SELECT
''
AS
one
,
i
.
*
FROM
INT4_TBL
i
WHERE
i
.
f1
=
'0'
::
int2
;
SELECT
''
AS
one
,
i
.
*
FROM
INT4_TBL
i
WHERE
i
.
f1
=
'0'
::
int4
;
SELECT
''
AS
two
,
i
.
*
FROM
INT4_TBL
i
WHERE
i
.
f1
<
'0'
::
int2
;
SELECT
''
AS
two
,
i
.
*
FROM
INT4_TBL
i
WHERE
i
.
f1
<
'0'
::
int4
;
SELECT
''
AS
three
,
i
.
*
FROM
INT4_TBL
i
WHERE
i
.
f1
<=
'0'
::
int2
;
SELECT
''
AS
three
,
i
.
*
FROM
INT4_TBL
i
WHERE
i
.
f1
<=
'0'
::
int4
;
SELECT
''
AS
two
,
i
.
*
FROM
INT4_TBL
i
WHERE
i
.
f1
>
'0'
::
int2
;
SELECT
''
AS
two
,
i
.
*
FROM
INT4_TBL
i
WHERE
i
.
f1
>
'0'
::
int4
;
SELECT
''
AS
three
,
i
.
*
FROM
INT4_TBL
i
WHERE
i
.
f1
>=
'0'
::
int2
;
SELECT
''
AS
three
,
i
.
*
FROM
INT4_TBL
i
WHERE
i
.
f1
>=
'0'
::
int4
;
-- positive odds
SELECT
''
AS
one
,
i
.
*
FROM
INT4_TBL
i
WHERE
(
i
.
f1
%
'2'
::
int2
)
=
'1'
::
int2
;
-- any evens
SELECT
''
AS
three
,
i
.
*
FROM
INT4_TBL
i
WHERE
(
i
.
f1
%
'2'
::
int4
)
=
'0'
::
int2
;
SELECT
''
AS
five
,
i
.
f1
,
i
.
f1
*
'2'
::
int2
AS
x
FROM
INT4_TBL
i
;
SELECT
''
AS
five
,
i
.
f1
,
i
.
f1
*
'2'
::
int4
AS
x
FROM
INT4_TBL
i
;
SELECT
''
AS
five
,
i
.
f1
,
i
.
f1
+
'2'
::
int2
AS
x
FROM
INT4_TBL
i
;
SELECT
''
AS
five
,
i
.
f1
,
i
.
f1
+
'2'
::
int4
AS
x
FROM
INT4_TBL
i
;
SELECT
''
AS
five
,
i
.
f1
,
i
.
f1
-
'2'
::
int2
AS
x
FROM
INT4_TBL
i
;
SELECT
''
AS
five
,
i
.
f1
,
i
.
f1
-
'2'
::
int4
AS
x
FROM
INT4_TBL
i
;
SELECT
''
AS
five
,
i
.
f1
,
i
.
f1
/
'2'
::
int2
AS
x
FROM
INT4_TBL
i
;
SELECT
''
AS
five
,
i
.
f1
,
i
.
f1
/
'2'
::
int4
AS
x
FROM
INT4_TBL
i
;
--
-- more complex expressions
--
SELECT
'2'
::
int2
*
'2'
::
int2
=
'16'
::
int2
/
'4'
::
int2
AS
true
;
SELECT
'2'
::
int4
*
'2'
::
int2
=
'16'
::
int2
/
'4'
::
int4
AS
true
;
SELECT
'2'
::
int2
*
'2'
::
int4
=
'16'
::
int4
/
'4'
::
int2
AS
true
;
SELECT
'1000'
::
int4
<
'999'
::
int4
AS
false
;
SELECT
4
!
AS
twenty_four
;
SELECT
!!
3
AS
six
;
SELECT
1
+
1
+
1
+
1
+
1
+
1
+
1
+
1
+
1
+
1
AS
ten
;
SELECT
2
+
2
/
2
AS
three
;
SELECT
(
2
+
2
)
/
2
AS
two
;
SELECT
dsqrt
(
'64'
::
float8
)
AS
eight
;
SELECT
|/
'64'
::
float8
AS
eight
;
SELECT
||/
'27'
::
float8
AS
three
;
src/test/regress/sql/misc.sql
0 → 100644
View file @
04688df6
This diff is collapsed.
Click to expand it.
src/test/regress/sql/oid.sql
0 → 100644
View file @
04688df6
-- *************testing built-in type oid ****************
CREATE
TABLE
OID_TBL
(
f1
oid
);
INSERT
INTO
OID_TBL
(
f1
)
VALUES
(
'1234'
);
INSERT
INTO
OID_TBL
(
f1
)
VALUES
(
'1235'
);
INSERT
INTO
OID_TBL
(
f1
)
VALUES
(
'987'
);
INSERT
INTO
OID_TBL
(
f1
)
VALUES
(
'-1040'
);
INSERT
INTO
OID_TBL
(
f1
)
VALUES
(
''
);
-- bad inputs
INSERT
INTO
OID_TBL
(
f1
)
VALUES
(
'asdfasd'
);
SELECT
''
AS
five
,
OID_TBL
.
*
;
SELECT
''
AS
one
,
o
.
*
FROM
OID_TBL
o
WHERE
o
.
f1
=
'1234'
::
oid
;
SELECT
''
AS
four
,
o
.
*
FROM
OID_TBL
o
WHERE
o
.
f1
<>
'1234'
;
SELECT
''
AS
four
,
o
.
*
FROM
OID_TBL
o
WHERE
o
.
f1
<=
'1234'
;
SELECT
''
AS
three
,
o
.
*
FROM
OID_TBL
o
WHERE
o
.
f1
<
'1234'
;
SELECT
''
AS
two
,
o
.
*
FROM
OID_TBL
o
WHERE
o
.
f1
>=
'1234'
;
SELECT
''
AS
one
,
o
.
*
FROM
OID_TBL
o
WHERE
o
.
f1
>
'1234'
;
src/test/regress/sql/oidint2.sql
0 → 100644
View file @
04688df6
-- *************testing built-in type oidint2 ****************
-- oidint2 is a an adt for multiple key indices involving oid and int2
-- probably will not be used directly by most users
CREATE
TABLE
OIDINT2_TBL
(
f1
oidint2
);
INSERT
INTO
OIDINT2_TBL
(
f1
)
VALUES
(
'1234/9873'
);
INSERT
INTO
OIDINT2_TBL
(
f1
)
VALUES
(
'1235/9873'
);
INSERT
INTO
OIDINT2_TBL
(
f1
)
VALUES
(
'987/-1234'
);
-- no int2 component
--
-- this is defined as good in the code -- I don't know what will break
-- if we disallow it.
--
INSERT
INTO
OIDINT2_TBL
(
f1
)
VALUES
(
'123456'
);
-- int2 component too large
INSERT
INTO
OIDINT2_TBL
(
f1
)
VALUES
(
'123456/123456'
);
--
-- this is defined as good in the code -- I don't know what will break
-- if we disallow it.
--
INSERT
INTO
OIDINT2_TBL
(
f1
)
VALUES
(
''
);
-- bad inputs
INSERT
INTO
OIDINT2_TBL
(
f1
)
VALUES
(
'asdfasd'
);
SELECT
''
AS
five
,
OIDINT2_TBL
.
*
;
SELECT
''
AS
one
,
o
.
*
FROM
OIDINT2_TBL
o
WHERE
o
.
f1
=
'1235/9873'
;
SELECT
''
AS
four
,
o
.
*
FROM
OIDINT2_TBL
o
WHERE
o
.
f1
<>
'1235/9873'
;
SELECT
''
AS
four
,
o
.
*
FROM
OIDINT2_TBL
o
WHERE
o
.
f1
<=
'1235/9873'
;
SELECT
''
AS
three
,
o
.
*
FROM
OIDINT2_TBL
o
WHERE
o
.
f1
<
'1235/9873'
;
SELECT
''
AS
two
,
o
.
*
FROM
OIDINT2_TBL
o
WHERE
o
.
f1
>=
'1235/9873'
;
SELECT
''
AS
one
,
o
.
*
FROM
OIDINT2_TBL
o
WHERE
o
.
f1
>
'1235/9873'
;
src/test/regress/sql/oidint4.sql
0 → 100644
View file @
04688df6
--*************testing built-in type oidint4 ****************
-- oidint4 is a an adt for multiple key indices involving oid and int4
-- probably will not be used directly by most users
CREATE
TABLE
OIDINT4_TBL
(
f1
oidint4
);
INSERT
INTO
OIDINT4_TBL
(
f1
)
VALUES
(
'1234/9873'
);
INSERT
INTO
OIDINT4_TBL
(
f1
)
VALUES
(
'1235/9873'
);
INSERT
INTO
OIDINT4_TBL
(
f1
)
VALUES
(
'987/-1234'
);
-- no int4 component
--
-- this is defined as good in the code -- I don't know what will break
-- if we disallow it.
--
INSERT
INTO
OIDINT4_TBL
(
f1
)
VALUES
(
'123456'
);
-- int4 component too large
INSERT
INTO
OIDINT4_TBL
(
f1
)
VALUES
(
'123456/1234568901234567890'
);
--
-- this is defined as good in the code -- I don't know what will break
-- if we disallow it.
--
INSERT
INTO
OIDINT4_TBL
(
f1
)
VALUES
(
''
);
-- bad inputs
INSERT
INTO
OIDINT4_TBL
(
f1
)
VALUES
(
'asdfasd'
);
SELECT
''
AS
five
,
OIDINT4_TBL
.
*
;
SELECT
''
AS
one
,
o
.
*
FROM
OIDINT4_TBL
o
WHERE
o
.
f1
=
'1235/9873'
;
SELECT
''
AS
four
,
o
.
*
FROM
OIDINT4_TBL
o
WHERE
o
.
f1
<>
'1235/9873'
;
SELECT
''
AS
four
,
o
.
*
FROM
OIDINT4_TBL
o
WHERE
o
.
f1
<=
'1235/9873'
;
SELECT
''
AS
three
,
o
.
*
FROM
OIDINT4_TBL
o
WHERE
o
.
f1
<
'1235/9873'
;
SELECT
''
AS
two
,
o
.
*
FROM
OIDINT4_TBL
o
WHERE
o
.
f1
>=
'1235/9873'
;
SELECT
''
AS
one
,
o
.
*
FROM
OIDINT4_TBL
o
WHERE
o
.
f1
>
'1235/9873'
;
src/test/regress/sql/oidname.sql
0 → 100644
View file @
04688df6
-- *************testing built-in type oidname ****************
-- oidname is a an adt for multiple key indices involving oid and name
-- probably will not be used directly by most users
CREATE
TABLE
OIDNAME_TBL
(
f1
oidname
);
INSERT
INTO
OIDNAME_TBL
(
f1
)
VALUES
(
'1234,abcd'
);
INSERT
INTO
OIDNAME_TBL
(
f1
)
VALUES
(
'1235,efgh'
);
INSERT
INTO
OIDNAME_TBL
(
f1
)
VALUES
(
'987,XXXX'
);
-- no char16 component
INSERT
INTO
OIDNAME_TBL
(
f1
)
VALUES
(
'123456'
);
-- char16 component too long
INSERT
INTO
OIDNAME_TBL
(
f1
)
VALUES
(
'123456,abcdefghijklmnopqrsutvwyz'
);
-- bad inputs
INSERT
INTO
OIDNAME_TBL
(
f1
)
VALUES
(
''
);
INSERT
INTO
OIDNAME_TBL
(
f1
)
VALUES
(
'asdfasd'
);
SELECT
''
AS
four
,
OIDNAME_TBL
.
*
;
SELECT
''
AS
one
,
o
.
*
FROM
OIDNAME_TBL
o
WHERE
o
.
f1
=
'1234,abcd'
;
SELECT
''
AS
three
,
o
.
*
FROM
OIDNAME_TBL
o
WHERE
o
.
f1
<>
'1234,abcd'
;
SELECT
''
AS
two
,
o
.
*
FROM
OIDNAME_TBL
o
WHERE
o
.
f1
<=
'1234,abcd'
;
SELECT
''
AS
one
,
o
.
*
FROM
OIDNAME_TBL
o
WHERE
o
.
f1
<
'1234,abcd'
;
SELECT
''
AS
three
,
o
.
*
FROM
OIDNAME_TBL
o
WHERE
o
.
f1
>=
'1234,abcd'
;
SELECT
''
AS
two
,
o
.
*
FROM
OIDNAME_TBL
o
WHERE
o
.
f1
>
'1234,abcd'
;
src/test/regress/sql/point.sql
0 → 100644
View file @
04688df6
-- ************testing built-in type point ****************
CREATE
TABLE
POINT_TBL
(
f1
point
);
INSERT
INTO
POINT_TBL
(
f1
)
VALUES
(
'(0.0,0.0)'
);
INSERT
INTO
POINT_TBL
(
f1
)
VALUES
(
'(-10.0,0.0)'
);
INSERT
INTO
POINT_TBL
(
f1
)
VALUES
(
'(-3.0,4.0)'
);
INSERT
INTO
POINT_TBL
(
f1
)
VALUES
(
'(5.1, 34.5)'
);
INSERT
INTO
POINT_TBL
(
f1
)
VALUES
(
'(-5.0,-12.0)'
);
-- bad format points
INSERT
INTO
POINT_TBL
(
f1
)
VALUES
(
'asdfasdf'
);
INSERT
INTO
POINT_TBL
(
f1
)
VALUES
(
'10.0,10.0'
);
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
.
*
;
-- left of
SELECT
''
AS
three
,
p
.
*
FROM
POINT_TBL
p
WHERE
p
.
f1
!<
'(0.0, 0.0)'
;
-- right of
SELECT
''
AS
three
,
p
.
*
FROM
POINT_TBL
p
WHERE
'(0.0,0.0)'
!>
p
.
f1
;
-- above
SELECT
''
AS
one
,
p
.
*
FROM
POINT_TBL
p
WHERE
'(0.0,0.0)'
!^
p
.
f1
;
-- below
SELECT
''
AS
one
,
p
.
*
FROM
POINT_TBL
p
WHERE
p
.
f1
!|
'(0.0, 0.0)'
;
-- equal
SELECT
''
AS
one
,
p
.
*
FROM
POINT_TBL
p
WHERE
p
.
f1
=|=
'(5.1, 34.5)'
;
-- point in box
SELECT
''
AS
two
,
p
.
*
FROM
POINT_TBL
p
WHERE
p
.
f1
===>
'(0,0,100,100)'
;
SELECT
''
AS
three
,
p
.
*
FROM
POINT_TBL
p
WHERE
not
on_pb
(
p
.
f1
,
'(0,0,100,100)'
::
box
);
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
twentyfive
,
p1
.
f1
,
p2
.
f1
,
p1
.
f1
<===>
p2
.
f1
AS
dist
FROM
POINT_TBL
p1
,
POINT_TBL
p2
;
SELECT
''
AS
twenty
,
p1
.
f1
,
p2
.
f1
FROM
POINT_TBL
p1
,
POINT_TBL
p2
WHERE
(
p1
.
f1
<===>
p2
.
f1
)
>
3
;
SELECT
''
AS
ten
,
p1
.
f1
,
p2
.
f1
FROM
POINT_TBL
p1
,
POINT_TBL
p2
WHERE
(
p1
.
f1
<===>
p2
.
f1
)
>
3
and
p1
.
f1
!<
p2
.
f1
;
SELECT
''
AS
two
,
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/polygon.sql
0 → 100644
View file @
04688df6
-- *************testing built-in type polygon ****************
--
-- polygon logic
--
-- 3 o
-- |
-- 2 + |
-- / |
-- 1 # o +
-- / |
-- 0 #-----o-+
--
-- 0 1 2 3 4
--
CREATE
TABLE
POLYGON_TBL
(
f1
polygon
);
INSERT
INTO
POLYGON_TBL
(
f1
)
VALUES
(
'(2.0,2.0,0.0,0.0,4.0,0.0)'
);
INSERT
INTO
POLYGON_TBL
(
f1
)
VALUES
(
'(3.0,3.0,1.0,1.0,3.0,0.0)'
);
-- degenerate polygons
INSERT
INTO
POLYGON_TBL
(
f1
)
VALUES
(
'(0.0,0.0)'
);
INSERT
INTO
POLYGON_TBL
(
f1
)
VALUES
(
'(0.0,0.0,1.0,1.0)'
);
-- bad polygon input strings
INSERT
INTO
POLYGON_TBL
(
f1
)
VALUES
(
'0.0'
);
INSERT
INTO
POLYGON_TBL
(
f1
)
VALUES
(
'(0.0 0.0'
);
INSERT
INTO
POLYGON_TBL
(
f1
)
VALUES
(
'(0,1,2)'
);
INSERT
INTO
POLYGON_TBL
(
f1
)
VALUES
(
'(0,1,2,3'
);
INSERT
INTO
POLYGON_TBL
(
f1
)
VALUES
(
'asdf'
);
SELECT
''
AS
four
,
POLYGON_TBL
.
*
;
-- overlap
SELECT
''
AS
three
,
p
.
*
FROM
POLYGON_TBL
p
WHERE
p
.
f1
&&
'(3.0,3.0,1.0,1.0,3.0,0.0)'
;
-- left overlap
SELECT
''
AS
four
,
p
.
*
FROM
POLYGON_TBL
p
WHERE
p
.
f1
&<
'(3.0,3.0,1.0,1.0,3.0,0.0)'
;
-- right overlap
SELECT
''
AS
two
,
p
.
*
FROM
POLYGON_TBL
p
WHERE
p
.
f1
&>
'(3.0,3.0,1.0,1.0,3.0,0.0)'
;
-- left of
SELECT
''
AS
one
,
p
.
*
FROM
POLYGON_TBL
p
WHERE
p
.
f1
<<
'(3.0,3.0,1.0,1.0,3.0,0.0)'
;
-- right of
SELECT
''
AS
zero
,
p
.
*
FROM
POLYGON_TBL
p
WHERE
p
.
f1
>>
'(3.0,3.0,1.0,1.0,3.0,0.0)'
;
-- contained
SELECT
''
AS
one
,
p
.
*
FROM
POLYGON_TBL
p
WHERE
p
.
f1
@
'(3.0,3.0,1.0,1.0,3.0,0.0)'
;
-- same
SELECT
''
AS
one
,
p
.
*
FROM
POLYGON_TBL
p
WHERE
p
.
f1
~=
'(3.0,3.0,1.0,1.0,3.0,0.0)'
;
-- contains
SELECT
''
AS
one
,
p
.
*
FROM
POLYGON_TBL
p
WHERE
p
.
f1
~
'(3.0,3.0,1.0,1.0,3.0,0.0)'
;
--
-- polygon logic
--
-- 3 o
-- |
-- 2 + |
-- / |
-- 1 / o +
-- / |
-- 0 +-----o-+
--
-- 0 1 2 3 4
--
-- left of
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
;
-- left overlap
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
true
;
-- right overlap
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
true
;
-- right of
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
;
-- contained in
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
;
-- contains
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
;
-- same
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
;
-- overlap
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
true
;
src/test/regress/sql/tests
View file @
04688df6
boolean
reltime
reltime
abstime
abstime
tinterval
boolean
box
box
char
char
char16
char2
char2
char4
char4
char8
float4
float8
int2
int4
misc
oid
oidint2
oidint4
oidname
point
polygon
text
tinterval
src/test/regress/sql/text.sql
0 → 100644
View file @
04688df6
-- *************testing built-in type text ****************
--
-- adt operators in the target list
--
-- fixed-length by reference
SELECT
'char 16 string'
::
char16
=
'char 16 string '
::
char16
AS
false
;
-- fixed-length by value
SELECT
'c'
::
char
=
'c'
::
char
AS
true
;
-- variable-length
SELECT
'this is a text string'
::
text
=
'this is a text string'
::
text
AS
true
;
SELECT
'this is a text string'
::
text
=
'this is a text strin'
::
text
AS
false
;
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