title: How to insert to Postgresql geometry column
body: <p>I have a WKT data which looks like so:</p>
  
  <pre><code>GEOMETRYCOLLECTION(
  POINT(-1763555.1165955865 310640.0829509564),
  POINT(-1421117.229877997 -300856.1433304538)
  )
  </code></pre>
  
  <p>The default projection is 'EPSG:3857'. In postgresql I created a parent table whith generic geometry column and several child tables with columns of specific geometry type. The schema looks like so:</p>
  
  <pre><code># parent table with generic geometry column "geom"
  CREATE TABLE "public"."layer_261_" (
  "id" int4 DEFAULT nextval('layer_261__id_seq'::regclass) NOT NULL,
  "feature_id" int4 DEFAULT 0 NOT NULL,
  "feature_name" varchar(200),
  "feature_type" varchar(50),
  "geom" "public"."geometry",
  "object_id" int4 DEFAULT 0 NOT NULL,
  "row_id" int4 DEFAULT 0 NOT NULL
  ) 
  WITH (OIDS=FALSE);
  ALTER TABLE "public"."layer_261_" ADD CHECK (st_srid(geom) = 3857);
  ALTER TABLE "public"."layer_261_" ADD CHECK (st_ndims(geom) = 2);
  ALTER TABLE "public"."layer_261_" ADD PRIMARY KEY ("id");
  
  # child table which is supposed to contain only POINT data type
  CREATE TABLE "public"."layer_261_points" (
  "id" int4 DEFAULT nextval('layer_261__id_seq'::regclass) NOT NULL,
  "feature_id" int4 DEFAULT 0 NOT NULL,
  "feature_name" varchar(200),
  "feature_type" varchar(50),
  "geom" "public"."geometry",
  "object_id" int4 DEFAULT 0 NOT NULL,
  "row_id" int4 DEFAULT 0 NOT NULL
  )
  INHERITS ("public"."layer_261_") 
  WITH (OIDS=FALSE);
  ALTER TABLE "public"."layer_261_points" ADD CHECK (st_ndims(geom) = 2);
  ALTER TABLE "public"."layer_261_points" ADD CHECK (geometrytype(geom) = 'POINT'::text);
  ALTER TABLE "public"."layer_261_points" ADD CHECK (st_srid(geom) = 3857);
  </code></pre>
  
  <p>So, how can I insert my data (two points to the database)? For example, I'm not sure whether I should convert points' coordinates to lat-lon. And besides, I'm not sure whether I should insert GEOMETRYCOLLECTION or all points one by one.</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>I've just tried to execute a query with a real data point:</p>
  
  <pre><code>INSERT INTO layer_261_ (geom) VALUES (ST_Point(105177.3509204, -85609.471679397))
  </code></pre>
  
  <p>But as a result I got this error message:</p>
  
  <blockquote>
    <p>new row for relation "layer_261_" violates check constraint
    "enforce_srid_geom"</p>
  </blockquote>
  
  <p>Does anybody know how to fix it?</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>This query leads to the very same error message:</p>
  
  <pre><code>INSERT INTO layer_261_ (geom) VALUES (ST_SetSRID(ST_Point(105177.3509204, -85609.471679397), 
  4326))
  </code></pre>