martin/tests/fixtures/table_source_multiple_geom.sql
Stepan Kuzmin fc9170d164
feat: add multiple geometry columns support in table sources (#269)
* feat: add multiple geometry columns support in table sources

* test: add multiple geometry tests
2021-10-21 12:20:33 +03:00

18 lines
764 B
SQL

CREATE TABLE table_source_multiple_geom (
gid serial PRIMARY KEY,
geom1 GEOMETRY(point, 4326),
geom2 GEOMETRY(point, 4326)
);
INSERT INTO table_source_multiple_geom
SELECT
generate_series(1, 10000) AS id,
(ST_DUMP (ST_GENERATEPOINTS (ST_GEOMFROMTEXT ('POLYGON ((-180 90, 180 90, 180 -90, -180 -90, -180 90))', 4326), 10000))).geom,
(ST_DUMP (ST_GENERATEPOINTS (ST_GEOMFROMTEXT ('POLYGON ((-180 90, 180 90, 180 -90, -180 -90, -180 90))', 4326), 10000))).geom;
CREATE INDEX ON table_source_multiple_geom USING GIST (geom1);
CREATE INDEX ON table_source_multiple_geom USING GIST (geom2);
CLUSTER table_source_multiple_geom_geom1_idx ON table_source_multiple_geom;
CLUSTER table_source_multiple_geom_geom2_idx ON table_source_multiple_geom;