Is it possible to use COPY
on a file full of WKT POINT
s without dropping the explicit SRID on the destination column?
I'm trying to insert several million rows of WGS84 points and am using COPY
for better performance over individual INSERT
s.
Content of foo.txt:
POINT(0 0)
POINT(0 1)
POINT(0 2)
Table:
CREATE TABLE foo (
geom GEOMETRY(POINT, 4326)
);
Command:
COPY foo FROM 'foo.txt';
Error message:
ERROR: Geometry SRID (0) does not match column SRID (4326)
CONTEXT: COPY foo, line 1, column geom: "POINT(0 0)"
Versions:
- PostgreSQL 9.2
- PostGIS 2.3