Answers:
http://postgis.net/docs/manual-2.0/ST_Force_2D.html
从...中选择ST_Force_2D(the_geom)
更新现有表格
ALTER TABLE your_geo_table ADD geom2d geometry;
UPDATE your_geo_table SET geom2d = ST_Force_2D(the_geom);
ST_Force2D
代替ST_Force_2d
。ST_Force_2d
2.1.0版弃用了签名。
如果您不想添加新列,也可以执行以下操作:
ALTER TABLE your_geo_table
ALTER COLUMN geom TYPE geometry(YOUR_GEOM_TYPE, YOUR_EPSG)
USING ST_Force_2D(geom);
例如:
ALTER TABLE your_geo_table
ALTER COLUMN geom TYPE geometry(MULTILINESTRING, 4326)
USING ST_Force_2D(geom);