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
3d9584c9
Commit
3d9584c9
authored
Jun 03, 1997
by
Thomas G. Lockhart
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update path and polygon syntax to new conventions.
parent
ad7952aa
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
33 additions
and
33 deletions
+33
-33
src/test/regress/sql/create_misc.sql
src/test/regress/sql/create_misc.sql
+10
-10
src/test/regress/sql/path.sql
src/test/regress/sql/path.sql
+2
-3
src/test/regress/sql/point.sql
src/test/regress/sql/point.sql
+1
-1
src/test/regress/sql/polygon.sql
src/test/regress/sql/polygon.sql
+20
-19
No files found.
src/test/regress/sql/create_misc.sql
View file @
3d9584c9
...
@@ -144,20 +144,20 @@ INSERT INTO e_star (class, e)
...
@@ -144,20 +144,20 @@ INSERT INTO e_star (class, e)
VALUES
(
'e'
,
'-4'
::
int2
);
VALUES
(
'e'
,
'-4'
::
int2
);
INSERT
INTO
f_star
(
class
,
a
,
c
,
e
,
f
)
INSERT
INTO
f_star
(
class
,
a
,
c
,
e
,
f
)
VALUES
(
'f'
,
19
,
'hi claire'
::
char16
,
'-5'
::
int2
,
'(1,
2,3
,4)'
::
polygon
);
VALUES
(
'f'
,
19
,
'hi claire'
::
char16
,
'-5'
::
int2
,
'(1,
3),(2
,4)'
::
polygon
);
INSERT
INTO
f_star
(
class
,
a
,
c
,
e
)
INSERT
INTO
f_star
(
class
,
a
,
c
,
e
)
VALUES
(
'f'
,
20
,
'hi mike'
::
char16
,
'-6'
::
int2
);
VALUES
(
'f'
,
20
,
'hi mike'
::
char16
,
'-6'
::
int2
);
INSERT
INTO
f_star
(
class
,
a
,
c
,
f
)
INSERT
INTO
f_star
(
class
,
a
,
c
,
f
)
VALUES
(
'f'
,
21
,
'hi marcel'
::
char16
,
'(11,
22,33,44,55
,66)'
::
polygon
);
VALUES
(
'f'
,
21
,
'hi marcel'
::
char16
,
'(11,
44),(22,55),(33
,66)'
::
polygon
);
INSERT
INTO
f_star
(
class
,
a
,
e
,
f
)
INSERT
INTO
f_star
(
class
,
a
,
e
,
f
)
VALUES
(
'f'
,
22
,
'-7'
::
int2
,
'(111,
222,333,444,555,666,777
,888)'
::
polygon
);
VALUES
(
'f'
,
22
,
'-7'
::
int2
,
'(111,
555),(222,666),(333,777),(444
,888)'
::
polygon
);
INSERT
INTO
f_star
(
class
,
c
,
e
,
f
)
INSERT
INTO
f_star
(
class
,
c
,
e
,
f
)
VALUES
(
'f'
,
'hi keith'
::
char16
,
'-8'
::
int2
,
VALUES
(
'f'
,
'hi keith'
::
char16
,
'-8'
::
int2
,
'(1111,
2222,3333
,4444)'
::
polygon
);
'(1111,
3333),(2222
,4444)'
::
polygon
);
INSERT
INTO
f_star
(
class
,
a
,
c
)
INSERT
INTO
f_star
(
class
,
a
,
c
)
VALUES
(
'f'
,
24
,
'hi marc'
::
char16
);
VALUES
(
'f'
,
24
,
'hi marc'
::
char16
);
...
@@ -166,17 +166,17 @@ INSERT INTO f_star (class, a, e)
...
@@ -166,17 +166,17 @@ INSERT INTO f_star (class, a, e)
VALUES
(
'f'
,
25
,
'-9'
::
int2
);
VALUES
(
'f'
,
25
,
'-9'
::
int2
);
INSERT
INTO
f_star
(
class
,
a
,
f
)
INSERT
INTO
f_star
(
class
,
a
,
f
)
VALUES
(
'f'
,
26
,
'(11111,
22222,33333
,44444)'
::
polygon
);
VALUES
(
'f'
,
26
,
'(11111,
33333),(22222
,44444)'
::
polygon
);
INSERT
INTO
f_star
(
class
,
c
,
e
)
INSERT
INTO
f_star
(
class
,
c
,
e
)
VALUES
(
'f'
,
'hi allison'
::
char16
,
'-10'
::
int2
);
VALUES
(
'f'
,
'hi allison'
::
char16
,
'-10'
::
int2
);
INSERT
INTO
f_star
(
class
,
c
,
f
)
INSERT
INTO
f_star
(
class
,
c
,
f
)
VALUES
(
'f'
,
'hi jeff'
::
char16
,
VALUES
(
'f'
,
'hi jeff'
::
char16
,
'(111111,
222222,333333
,444444)'
::
polygon
);
'(111111,
333333),(222222
,444444)'
::
polygon
);
INSERT
INTO
f_star
(
class
,
e
,
f
)
INSERT
INTO
f_star
(
class
,
e
,
f
)
VALUES
(
'f'
,
'-11'
::
int2
,
'(1111111,
2222222,3333333
,4444444)'
::
polygon
);
VALUES
(
'f'
,
'-11'
::
int2
,
'(1111111,
3333333),(2222222
,4444444)'
::
polygon
);
INSERT
INTO
f_star
(
class
,
a
)
VALUES
(
'f'
,
27
);
INSERT
INTO
f_star
(
class
,
a
)
VALUES
(
'f'
,
27
);
...
@@ -185,7 +185,7 @@ INSERT INTO f_star (class, c) VALUES ('f', 'hi carl'::char16);
...
@@ -185,7 +185,7 @@ INSERT INTO f_star (class, c) VALUES ('f', 'hi carl'::char16);
INSERT
INTO
f_star
(
class
,
e
)
VALUES
(
'f'
,
'-12'
::
int2
);
INSERT
INTO
f_star
(
class
,
e
)
VALUES
(
'f'
,
'-12'
::
int2
);
INSERT
INTO
f_star
(
class
,
f
)
INSERT
INTO
f_star
(
class
,
f
)
VALUES
(
'f'
,
'(11111111,
22222222,33333333
,44444444)'
::
polygon
);
VALUES
(
'f'
,
'(11111111,
33333333),(22222222
,44444444)'
::
polygon
);
INSERT
INTO
f_star
(
class
)
VALUES
(
'f'
);
INSERT
INTO
f_star
(
class
)
VALUES
(
'f'
);
...
@@ -223,8 +223,8 @@ CREATE TABLE iportaltest (
...
@@ -223,8 +223,8 @@ CREATE TABLE iportaltest (
);
);
INSERT
INTO
iportaltest
(
i
,
d
,
p
)
INSERT
INTO
iportaltest
(
i
,
d
,
p
)
VALUES
(
1
,
3
.
567
,
'(3.0,
4.0,1
.0,2.0)'
::
polygon
);
VALUES
(
1
,
3
.
567
,
'(3.0,
1.0),(4
.0,2.0)'
::
polygon
);
INSERT
INTO
iportaltest
(
i
,
d
,
p
)
INSERT
INTO
iportaltest
(
i
,
d
,
p
)
VALUES
(
2
,
89
.
05
,
'(4.0,
3.0,2
.0,1.0)'
::
polygon
);
VALUES
(
2
,
89
.
05
,
'(4.0,
2.0),(3
.0,1.0)'
::
polygon
);
src/test/regress/sql/path.sql
View file @
3d9584c9
...
@@ -18,10 +18,9 @@ INSERT INTO PATH_TBL VALUES ('1,2 ,3,4');
...
@@ -18,10 +18,9 @@ INSERT INTO PATH_TBL VALUES ('1,2 ,3,4');
INSERT
INTO
PATH_TBL
VALUES
(
'[1,2,3, 4]'
);
INSERT
INTO
PATH_TBL
VALUES
(
'[1,2,3, 4]'
);
-- obsolete v6.0 format (closed,count,x1,y1,...)
INSERT
INTO
PATH_TBL
VALUES
(
'[11,12,13,14]'
);
INSERT
INTO
PATH_TBL
VALUES
(
'(0,2,11,12,13,14)'
);
INSERT
INTO
PATH_TBL
VALUES
(
'(1
,2,1
1,12,13,14)'
);
INSERT
INTO
PATH_TBL
VALUES
(
'(11,12,13,14)'
);
-- bad values for parser testing
-- bad values for parser testing
INSERT
INTO
PATH_TBL
VALUES
(
'[(,2),(3,4)]'
);
INSERT
INTO
PATH_TBL
VALUES
(
'[(,2),(3,4)]'
);
...
...
src/test/regress/sql/point.sql
View file @
3d9584c9
...
@@ -47,7 +47,7 @@ SELECT '' AS three, p.* FROM POINT_TBL p
...
@@ -47,7 +47,7 @@ SELECT '' AS three, p.* FROM POINT_TBL p
WHERE
not
on_pb
(
p
.
f1
,
'(0,0,100,100)'
::
box
);
WHERE
not
on_pb
(
p
.
f1
,
'(0,0,100,100)'
::
box
);
SELECT
''
AS
two
,
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
);
WHERE
on_ppath
(
p
.
f1
,
'
[(0,0),(-10,0),(-10,10)]
'
::
path
);
SELECT
''
AS
six
,
p
.
f1
,
p
.
f1
<===>
'(0,0)'
::
point
AS
dist
SELECT
''
AS
six
,
p
.
f1
,
p
.
f1
<===>
'(0,0)'
::
point
AS
dist
FROM
POINT_TBL
p
FROM
POINT_TBL
p
...
...
src/test/regress/sql/polygon.sql
View file @
3d9584c9
...
@@ -16,14 +16,15 @@
...
@@ -16,14 +16,15 @@
CREATE
TABLE
POLYGON_TBL
(
f1
polygon
);
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
(
'(2.0,
0.0),(2.0,4.0),(0
.0,0.0)'
);
INSERT
INTO
POLYGON_TBL
(
f1
)
VALUES
(
'(3.0,
3.0,1.0,1.0,3
.0,0.0)'
);
INSERT
INTO
POLYGON_TBL
(
f1
)
VALUES
(
'(3.0,
1.0),(3.0,3.0),(1
.0,0.0)'
);
-- degenerate polygons
-- degenerate polygons
INSERT
INTO
POLYGON_TBL
(
f1
)
VALUES
(
'(0.0,0.0)'
);
INSERT
INTO
POLYGON_TBL
(
f1
)
VALUES
(
'(0.0,0.0)'
);
INSERT
INTO
POLYGON_TBL
(
f1
)
VALUES
(
'(0.0,0.0,1.0,1.0)'
);
INSERT
INTO
POLYGON_TBL
(
f1
)
VALUES
(
'(0.0,1.0),(0.0,1.0)'
);
-- bad polygon input strings
-- bad polygon input strings
INSERT
INTO
POLYGON_TBL
(
f1
)
VALUES
(
'0.0'
);
INSERT
INTO
POLYGON_TBL
(
f1
)
VALUES
(
'0.0'
);
...
@@ -41,42 +42,42 @@ SELECT '' AS four, POLYGON_TBL.*;
...
@@ -41,42 +42,42 @@ SELECT '' AS four, POLYGON_TBL.*;
-- overlap
-- overlap
SELECT
''
AS
three
,
p
.
*
SELECT
''
AS
three
,
p
.
*
FROM
POLYGON_TBL
p
FROM
POLYGON_TBL
p
WHERE
p
.
f1
&&
'(3.0,
3.0,1.0,1.0,3
.0,0.0)'
;
WHERE
p
.
f1
&&
'(3.0,
1.0),(3.0,3.0),(1
.0,0.0)'
;
-- left overlap
-- left overlap
SELECT
''
AS
four
,
p
.
*
SELECT
''
AS
four
,
p
.
*
FROM
POLYGON_TBL
p
FROM
POLYGON_TBL
p
WHERE
p
.
f1
&<
'(3.0,
3.0,1.0,1.0,3
.0,0.0)'
;
WHERE
p
.
f1
&<
'(3.0,
1.0),(3.0,3.0),(1
.0,0.0)'
;
-- right overlap
-- right overlap
SELECT
''
AS
two
,
p
.
*
SELECT
''
AS
two
,
p
.
*
FROM
POLYGON_TBL
p
FROM
POLYGON_TBL
p
WHERE
p
.
f1
&>
'(3.0,
3.0,1.0,1.0,3
.0,0.0)'
;
WHERE
p
.
f1
&>
'(3.0,
1.0),(3.0,3.0),(1
.0,0.0)'
;
-- left of
-- left of
SELECT
''
AS
one
,
p
.
*
SELECT
''
AS
one
,
p
.
*
FROM
POLYGON_TBL
p
FROM
POLYGON_TBL
p
WHERE
p
.
f1
<<
'(3.0,
3.0,1.0,1.0,3
.0,0.0)'
;
WHERE
p
.
f1
<<
'(3.0,
1.0),(3.0,3.0),(1
.0,0.0)'
;
-- right of
-- right of
SELECT
''
AS
zero
,
p
.
*
SELECT
''
AS
zero
,
p
.
*
FROM
POLYGON_TBL
p
FROM
POLYGON_TBL
p
WHERE
p
.
f1
>>
'(3.0,
3.0,1.0,1.0,3
.0,0.0)'
;
WHERE
p
.
f1
>>
'(3.0,
1.0),(3.0,3.0),(1
.0,0.0)'
;
-- contained
-- contained
SELECT
''
AS
one
,
p
.
*
SELECT
''
AS
one
,
p
.
*
FROM
POLYGON_TBL
p
FROM
POLYGON_TBL
p
WHERE
p
.
f1
@
'(3.0,
3.0,1.0,1.0,3
.0,0.0)'
;
WHERE
p
.
f1
@
'(3.0,
1.0),(3.0,3.0),(1
.0,0.0)'
;
-- same
-- same
SELECT
''
AS
one
,
p
.
*
SELECT
''
AS
one
,
p
.
*
FROM
POLYGON_TBL
p
FROM
POLYGON_TBL
p
WHERE
p
.
f1
~=
'(3.0,
3.0,1.0,1.0,3
.0,0.0)'
;
WHERE
p
.
f1
~=
'(3.0,
1.0),(3.0,3.0),(1
.0,0.0)'
;
-- contains
-- contains
SELECT
''
AS
one
,
p
.
*
SELECT
''
AS
one
,
p
.
*
FROM
POLYGON_TBL
p
FROM
POLYGON_TBL
p
WHERE
p
.
f1
~
'(3.0,
3.0,1.0,1.0,3
.0,0.0)'
;
WHERE
p
.
f1
~
'(3.0,
1.0),(3.0,3.0),(1
.0,0.0)'
;
--
--
-- polygon logic
-- polygon logic
...
@@ -92,26 +93,26 @@ SELECT '' AS one, p.*
...
@@ -92,26 +93,26 @@ SELECT '' AS one, p.*
-- 0 1 2 3 4
-- 0 1 2 3 4
--
--
-- left of
-- 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
;
SELECT
'(2.0,
0.0),(2.0,4.0),(0.0,0.0)'
::
polygon
<<
'(3.0,1.0),(3.0,3.0),(1
.0,0.0)'
::
polygon
AS
false
;
-- left overlap
-- 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
;
SELECT
'(2.0,
0.0),(2.0,4.0),(0.0,0.0)'
::
polygon
<<
'(3.0,1.0),(3.0,3.0),(1
.0,0.0)'
::
polygon
AS
true
;
-- right overlap
-- 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
;
SELECT
'(2.0,
0.0),(2.0,4.0),(0.0,0.0)'
::
polygon
&>
'(3.0,1.0),(3.0,3.0),(1
.0,0.0)'
::
polygon
AS
true
;
-- right of
-- 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
;
SELECT
'(2.0,
0.0),(2.0,4.0),(0.0,0.0)'
::
polygon
>>
'(3.0,1.0),(3.0,3.0),(1
.0,0.0)'
::
polygon
AS
false
;
-- contained in
-- 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
;
SELECT
'(2.0,
0.0),(2.0,4.0),(0.0,0.0)'
::
polygon
@
'(3.0,1.0),(3.0,3.0),(1
.0,0.0)'
::
polygon
AS
false
;
-- contains
-- 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
;
SELECT
'(2.0,
0.0),(2.0,4.0),(0.0,0.0)'
::
polygon
~
'(3.0,1.0),(3.0,3.0),(1
.0,0.0)'
::
polygon
AS
false
;
-- same
-- 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
;
SELECT
'(2.0,
0.0),(2.0,4.0),(0.0,0.0)'
::
polygon
~=
'(3.0,1.0),(3.0,3.0),(1
.0,0.0)'
::
polygon
AS
false
;
-- overlap
-- 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
;
SELECT
'(2.0,
0.0),(2.0,4.0),(0.0,0.0)'
::
polygon
&&
'(3.0,1.0),(3.0,3.0),(1
.0,0.0)'
::
polygon
AS
true
;
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