[postgis-devel] Typmod'ing

Paul Ramsey pramsey at opengeo.org
Fri Jul 24 16:27:39 PDT 2009


Looking good now:

geography=# create table foo1 (g geography(4326));
CREATE TABLE
geography=# \d foo1
          Table "public.foo1"
  Column |      Type       | Modifiers
--------+-----------------+-----------
  g      | geography(4326) |

geography=# insert into foo1 values ('SRID=1;POINT(0 0)');
ERROR:  Geometry SRID (1) does not match column SRID (4326)
geography=# insert into foo1 values ('SRID=4326;POINT(0 0)');
INSERT 0 1
geography=# create table foo2 (g geography(4326,POINTZM));
CREATE TABLE
geography=# \d foo2
              Table "public.foo2"
  Column |          Type           | Modifiers
--------+-------------------------+-----------
  g      | geography(4326,PointZM) |

geography=# insert into foo2 values ('SRID=4326;POINT(0 0)');
ERROR:  Column has Z dimension but geometry does not
geography=# insert into foo2 values ('SRID=4326;POINT(0 0 0)');
ERROR:  Column has M dimension but geometry does not
geography=# insert into foo2 values ('SRID=4326;POINT(0 0 0 0)');
INSERT 0 1
geography=# insert into foo2 values ('SRID=4326;LINESTRING(1 1 1 1,0 0  
0 0)');
ERROR:  Geometry type (Line) does not match column type (Point)





More information about the postgis-devel mailing list