2.0.0
AddTopoGeometryColumn DropTopoGeometryColumn CreateTopology
3395
1
3
5
0.5
0.75
100
1
2
XDR
'monkey'
'test'
'SPHEROID["GRS_1980",6378137,298.257222101]'
'FF1FF0102'
false
postgis_garden_log
UPDATE SET log_end = clock_timestamp()
FROM (SELECT logid FROM ORDER BY logid DESC limit 1) As foo
WHERE .logid = foo.logid AND .log_end IS NULL;
INSERT INTO _output(logid, log_output)
SELECT logid, query_to_xml(log_sql, false,false,'') As log_output
FROM ORDER BY logid DESC LIMIT 1;
(SELECT ST_SetSRID(ST_Point(i,j),4326) As the_geom
FROM (SELECT a*1.11111111 FROM generate_series(-10,50,10) As a) As i(i)
CROSS JOIN generate_series(40,70, 15) j
ORDER BY i,j
)
(SELECT ST_MakeLine(ST_SetSRID(ST_Point(i,j),4326),ST_SetSRID(ST_Point(j,i),4326)) As the_geom
FROM (SELECT a*1.11111111 FROM generate_series(-10,50,10) As a) As i(i)
CROSS JOIN generate_series(40,70, 15) As j
WHERE NOT(i = j)
ORDER BY i, i*j)
(SELECT ST_Buffer(ST_SetSRID(ST_Point(i,j),4326), j*0.05) As the_geom
FROM (SELECT a*1.11111111 FROM generate_series(-10,50,10) As a) As i(i)
CROSS JOIN generate_series(40,70, 20) As j
ORDER BY i, i*j, j)
(SELECT ST_SetSRID(ST_MakePointM(i,j,m),4326) As the_geom
FROM generate_series(-10,50,10) As i
CROSS JOIN generate_series(50,70, 20) AS j
CROSS JOIN generate_series(1,2) As m
ORDER BY i, j, i*j*m)
(SELECT ST_MakeLine(ST_SetSRID(ST_MakePointM(i,j,m),4326),ST_SetSRID(ST_MakePointM(j,i,m),4326)) As the_geom
FROM generate_series(-10,50,10) As i
CROSS JOIN generate_series(50,70, 20) As j
CROSS JOIN generate_series(1,2) As m
WHERE NOT(i = j)
ORDER BY i, j, m, i*j*m)
(SELECT geom As the_geom
FROM (VALUES ( ST_GeomFromEWKT('SRID=4326;POLYGONM((-71.1319 42.2503 1,-71.132 42.2502 3,-71.1323 42.2504 -2,-71.1322 42.2505 1,-71.1319 42.2503 0))') ),
( ST_GeomFromEWKT('SRID=4326;POLYGONM((-71.1319 42.2512 0,-71.1318 42.2511 20,-71.1317 42.2511 -20,-71.1317 42.251 5,-71.1317 42.2509 4,-71.132 42.2511 6,-71.1319 42.2512 30))') )
) As g(geom))
(SELECT ST_SetSRID(ST_MakePoint(i,j,k),4326) As the_geom
FROM generate_series(-10,50,20) As i
CROSS JOIN generate_series(40,70, 20) j
CROSS JOIN generate_series(1,2) k
ORDER BY i,i*j, j*k, i + j + k)
(SELECT ST_SetSRID(ST_MakeLine(ST_MakePoint(i,j,k), ST_MakePoint(i+k,j+k,k)),4326) As the_geom
FROM generate_series(-10,50,20) As i
CROSS JOIN generate_series(40,70, 20) j
CROSS JOIN generate_series(1,2) k
ORDER BY i, j, i+j+k, k, i*j*k)
(SELECT geom As the_geom
FROM (VALUES ( ST_GeomFromEWKT('SRID=4326;POLYGON((-71.0771 42.3866 1,-71.0767 42.3872 1,-71.0767 42.3863 1,-71.0771 42.3866 1))') ),
( ST_GeomFromEWKT('SRID=4326;POLYGON((-71.0775 42.386 2,-71.0773 42.3863 1.75,-71.0773 42.3859 1.75,-71.0775 42.386 2))') )
) As g(geom))
(SELECT geom As the_geom
FROM (VALUES ( ST_GeomFromEWKT('SRID=4326;POLYGON((-71.0771 42.3866 1 2,-71.0767 42.3872 1 2.3,-71.0767 42.3863 1 2.3,-71.0771 42.3866 1 2))') ),
( ST_GeomFromEWKT('SRID=4326;POLYGON((-71.0775 42.386 2 1.5,-71.0773 42.3863 1.75 1.5,-71.0773 42.3859 1.75 1.5,-71.0775 42.386 2 1.5))') )
) As g(geom))
(SELECT ST_Collect(s.the_geom) As the_geom
FROM (SELECT ST_SetSRID(ST_Point(i,j),4326) As the_geom
FROM generate_series(-10,50,15) As i
CROSS JOIN generate_series(40,70, 15) j
) As s)
(SELECT ST_Collect(s.the_geom) As the_geom
FROM (SELECT ST_MakeLine(ST_SetSRID(ST_Point(i,j),4326),ST_SetSRID(ST_Point(j,i),4326)) As the_geom
FROM generate_series(-10,50,10) As i
CROSS JOIN generate_series(40,70, 15) As j
WHERE NOT(i = j)) As s)
(SELECT ST_Multi(ST_Union(ST_Buffer(ST_SetSRID(ST_Point(i,j),4326), j*0.05))) As the_geom
FROM generate_series(-10,50,10) As i
CROSS JOIN generate_series(40,70, 25) As j)
(SELECT ST_Collect(ST_SetSRID(ST_MakePoint(i,j,k),4326)) As the_geom
FROM generate_series(-10,50,20) As i
CROSS JOIN generate_series(40,70, 25) j
CROSS JOIN generate_series(1,3) k
)
(SELECT ST_Multi(ST_Union(ST_SetSRID(ST_MakeLine(ST_MakePoint(i,j,k), ST_MakePoint(i+k,j+k,k)),4326))) As the_geom
FROM generate_series(-10,50,20) As i
CROSS JOIN generate_series(40,70, 25) j
CROSS JOIN generate_series(1,2) k
)
(SELECT geom As the_geom
FROM (VALUES ( ST_GeomFromEWKT('SRID=4326;MULTIPOLYGON(((-71.0821 42.3036 2,-71.0822 42.3036 2,-71.082 42.3038 2,-71.0819 42.3037 2,-71.0821 42.3036 2)))') ),
( ST_GeomFromEWKT('SRID=4326;MULTIPOLYGON(((-71.1261 42.2703 1,-71.1257 42.2703 1,-71.1257 42.2701 1,-71.126 42.2701 1,-71.1261 42.2702 1,-71.1261 42.2703 1)))') )
) As g(geom))
(SELECT ST_Collect(s.the_geom) As the_geom
FROM (SELECT ST_SetSRID(ST_MakePointM(i - 0.0821,j + 0.3036,m),4326) As the_geom
FROM generate_series(-71,50,15) As i
CROSS JOIN generate_series(42,70, 25) AS j
CROSS JOIN generate_series(1,2) As m
) As s)
(SELECT ST_Collect(s.the_geom) As the_geom
FROM (SELECT ST_MakeLine(ST_SetSRID(ST_MakePointM(i - 0.0821,j + 0.3036,m),4326),ST_SetSRID(ST_MakePointM(j,i,m),4326)) As the_geom
FROM generate_series(-71,50,15) As i
CROSS JOIN generate_series(50,70, 25) As j
CROSS JOIN generate_series(1,2) As m
WHERE NOT(i = j)) As s)
(
SELECT ST_GeomFromEWKT('SRID=4326;MULTIPOLYGONM(((0 0 2,10 0 1,10 10 -2,0 10 -5,0 0 -5),(5 5 6,7 5 6,7 7 6,5 7 10,5 5 -2)))') As the_geom
)
DROP TABLE IF EXISTS ;
CREATE TABLE (logid serial PRIMARY KEY, log_label text, spatial_class text, func text, g1 text, g2 text, log_start timestamp, log_end timestamp, log_sql text);
DROP TABLE IF EXISTS _output;
CREATE TABLE _output(logid integer PRIMARY KEY, log_output xml);
table Test
SELECT ': Start Testing';
CREATE TABLE pgis_garden (gid serial);
SELECT AddGeometryColumn('pgis_garden','the_geom',ST_SRID(the_geom),GeometryType(the_geom),ST_CoordDim(the_geom))
FROM () As foo limit 1;
SELECT AddGeometryColumn('pgis_garden','the_geom_multi',ST_SRID(the_geom),GeometryType(ST_Multi(the_geom)),ST_CoordDim(the_geom))
FROM () As foo limit 1;
INSERT INTO (log_label, func, g1, log_start, log_sql)
VALUES(' AddGeometryColumn','AddGeometryColumn', '', clock_timestamp(),
'');
BEGIN;
COMMIT;
SELECT ' Geometry index: Start Testing ';
INSERT INTO (log_label, func, g1, log_start) VALUES(' gist index Geometry','CREATE gist index geometry', '', clock_timestamp());
BEGIN;
CREATE INDEX idx_pgis_geom_gist ON pgis_garden USING gist(the_geom);
COMMIT;
SELECT ' geometry index: End Testing ';
INSERT INTO (log_label, func, g1, log_start)
VALUES(' insert data Geometry','insert data', '', clock_timestamp());
BEGIN;
INSERT INTO pgis_garden(the_geom, the_geom_multi)
SELECT the_geom, ST_Multi(the_geom)
FROM () As foo;
COMMIT;
INSERT INTO (log_label, func, g1, log_start)
VALUES(' UpdateGeometrySRID','UpdateGeometrySRID', '', clock_timestamp());
BEGIN;
SELECT UpdateGeometrySRID('pgis_garden', 'the_geom', 4269);
COMMIT;
INSERT INTO (log_label, func, g1, log_start)
VALUES(' vacuum analyze Geometry','vacuum analyze Geometry', '', clock_timestamp());
VACUUM ANALYZE pgis_garden;
INSERT INTO (log_label, func, g1, log_start)
VALUES(' DropGeometryColumn','DropGeometryColumn', '', clock_timestamp());
BEGIN;
SELECT DropGeometryColumn ('pgis_garden','the_geom');
COMMIT;
INSERT INTO (log_label, func, g1, log_start)
VALUES(' DropGeometryTable','DropGeometryTable', '', clock_timestamp());
BEGIN;
SELECT DropGeometryTable ('pgis_garden');
COMMIT;
SELECT ': End Testing ';
SELECT ' Geography: Start Testing ';
INSERT INTO (log_label, func, g1, log_start) VALUES(' Create Table / Add data - Geography','CREATE TABLE geography', '', clock_timestamp());
BEGIN;
CREATE TABLE pgis_geoggarden (gid serial PRIMARY KEY, the_geog geography(, 4326));
INSERT INTO pgis_geoggarden(the_geog)
SELECT the_geom
FROM () As foo;
COMMIT;
SELECT ' Geography: End Testing ';
SELECT ' Geography index: Start Testing ';
INSERT INTO (log_label, func, g1, log_start) VALUES(' gist index Geography','CREATE gist index geography', '', clock_timestamp());
BEGIN;
CREATE INDEX idx_pgis_geoggarden_geog_gist ON pgis_geoggarden USING gist(the_geog);
COMMIT;
SELECT ' Geography index: End Testing ';
INSERT INTO (log_label, func, g1, log_start, log_sql) VALUES(' vacuum analyze Geography','analyze geography table', '', clock_timestamp(),
'VACUUM ANALYZE pgis_geoggarden;');
VACUUM ANALYZE pgis_geoggarden;
INSERT INTO (log_label, func, g1, log_start) VALUES(' drop Geography table','drop geography table', '', clock_timestamp());
BEGIN;
SELECT 'BEFORE DROP' As look_at, * FROM geography_columns;
DROP TABLE pgis_geoggarden;
SELECT 'AFTER DROP' As look_at, * FROM geography_columns;
COMMIT;
SELECT ' Geography: End Testing';
against other types
SELECT ': Start Testing ';
INSERT INTO (log_label, func, g1, g2, log_start, log_sql)
VALUES(' Geography ','', '','', clock_timestamp(),
'
SELECT ST_AsEWKT(foo1.the_geom) as ewktgeog1, ST_AsEWKT(foo2.the_geom) as ewktgeog2, geography(foo1.the_geom) geography(foo2.the_geom) As geog1_op_geog2
FROM () As foo1 CROSS JOIN () As foo2
WHERE (geography(foo1.the_geom) geography(foo2.the_geom)) = true OR
(geography(foo1.the_geom) geography(foo2.the_geom)) = false;
');
SELECT 'Geography : Start Testing , ';
BEGIN;
COMMIT;
SELECT 'Geometry : Start Testing , ';
INSERT INTO (log_label, func, g1, g2, log_start, log_sql)
VALUES(' Geometry ','', '','', clock_timestamp(),
'
SELECT ST_AsEWKT(foo1.the_geom) as ewktgeom1, ST_AsEWKT(foo2.the_geom) as ewktgeom2, foo1.the_geom foo2.the_geom As geom1_op_geom2
FROM () As foo1 CROSS JOIN () As foo2
WHERE (foo1.the_geom foo2.the_geom) = true OR
(foo1.the_geom foo2.the_geom) = false;');
BEGIN;
COMMIT;
SELECT ' : End Testing against other types';
()
SELECT 'Starting ()';
INSERT INTO (log_label, func, log_start, log_sql)
VALUES(' ','', clock_timestamp(),
'
SELECT () As output;');
BEGIN;
COMMIT;
SELECT 'Ending ()';
SELECT ' : Start Testing';
INSERT INTO (log_label, func, g1, log_start, log_sql)
VALUES(' ','', '', clock_timestamp(),
'
SELECT () As result
FROM () As foo1
LIMIT 3;');
BEGIN;
COMMIT;
SELECT ' : End Testing';
SELECT ' (): Start Testing against other types';
INSERT INTO (log_label, func, g1, g2, log_start, log_sql)
VALUES(' ','','', '', clock_timestamp(),
'
SELECT () As result, ST_AsText(foo1.the_geom) As ref1_geom, ST_AsText(foo2.the_geom) As ref2_geom
FROM () As foo1 CROSS JOIN () As foo2
LIMIT 2;');
BEGIN;
COMMIT;
INSERT INTO (log_label, func, g1, g2, log_start, log_sql)
VALUES(' Other ','', '','', clock_timestamp(),
'
SELECT ()');
SELECT 'Other (): Start Testing , ';
BEGIN;
COMMIT;
SELECT '() : End Testing , ';
SELECT ' (): End Testing against other types';
UPDATE SET spatial_class = 'geography' WHERE (log_label ILIKE '%geography%' or log_sql ILIKE '%geography%') AND spatial_class IS NULL;
UPDATE SET spatial_class = 'geometry' WHERE log_label ILIKE '%geometry%' or log_label ILIKE '%other%' AND spatial_class IS NULL;
''
ST_AsGML(foo1.the_geom)
ST_AsKML(foo1.the_geom)
foo1.the_geom
geography(foo1.the_geom)
foo2.the_geom
geography(foo2.the_geom)
ARRAY[foo1.the_geom]
ARRAY[foo2.the_geom]
ST_AsEWKT(foo1.the_geom)
ST_AsText(foo1.the_geom)
ST_AsEWKB(foo1.the_geom)
ST_AsBinary(foo1.the_geom)
'2009-01-01'
,
,
'
''