I'm trying to input some data into a PostgreSQL 8.4 database with a PostGIS template. I'm unable to UPDATE
polygons:
> UPDATE my_table SET coords = POINT(1, 1)
UPDATE 0 1
> UPDATE my_table SET box = POLYGON(((1, 1), (2, 3), (3, 3), (1, 1)))
ERROR: function polygon(record) does not exist
> UPDATE my_table SET box = POLYGON((1, 1), (2, 3), (3, 3), (1, 1))
ERROR: function polygon(record, record, record, record) does not exist
> UPDATE my_table SET box = POLYGON(1, 1, 2, 3, 3, 3, 1, 1)
ERROR: function polygon(numeric, numeric, numeric, numeric, numeric, numeric, numeric, numeric) does not exist
> UPDATE my_table SET box = ((1, 1), (2, 3), (3, 3), (1, 1))
ERROR: column "box" is of type polygon but expression is of type record
How do I insert a polygon? Note that the data already exists in the table, with NULL
fields in place of the spatial data. I need to UPDATE
, not INSERT
, but that shouldn't make a difference.