mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-12-21 08:29:39 +08:00
aa4c702eac
Create objects in public schema. Make spacing/capitalization consistent. Remove transaction block use for object creation. Remove unneeded function GRANTs.
56 lines
974 B
Plaintext
56 lines
974 B
Plaintext
--
|
|
-- first, define the datatype. Turn off echoing so that expected file
|
|
-- does not depend on contents of seg.sql.
|
|
--
|
|
\set ECHO none
|
|
CREATE TABLE boxtmp (b box);
|
|
\copy boxtmp from 'data/test_box.data'
|
|
SELECT count(*)
|
|
FROM boxtmp
|
|
WHERE b && '(1000,1000,0,0)'::box;
|
|
count
|
|
-------
|
|
2
|
|
(1 row)
|
|
|
|
CREATE INDEX bix ON boxtmp USING rtree (b);
|
|
SELECT count(*)
|
|
FROM boxtmp
|
|
WHERE b && '(1000,1000,0,0)'::box;
|
|
count
|
|
-------
|
|
2
|
|
(1 row)
|
|
|
|
DROP INDEX bix;
|
|
CREATE INDEX bix ON boxtmp USING gist (b);
|
|
SELECT count(*)
|
|
FROM boxtmp
|
|
WHERE b && '(1000,1000,0,0)'::box;
|
|
count
|
|
-------
|
|
2
|
|
(1 row)
|
|
|
|
CREATE TABLE polytmp (p polygon);
|
|
\copy polytmp from 'data/test_box.data'
|
|
CREATE INDEX pix ON polytmp USING rtree (p);
|
|
SELECT count(*)
|
|
FROM polytmp
|
|
WHERE p && '(1000,1000),(0,0)'::polygon;
|
|
count
|
|
-------
|
|
2
|
|
(1 row)
|
|
|
|
DROP INDEX pix;
|
|
CREATE INDEX pix ON polytmp USING gist (p);
|
|
SELECT count(*)
|
|
FROM polytmp
|
|
WHERE p && '(1000,1000),(0,0)'::polygon;
|
|
count
|
|
-------
|
|
2
|
|
(1 row)
|
|
|