<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>If I try to insert a row containing particular coordinate, the query fails and the DB connection is lost. (By comparison, hundreds of inserts of other coordinates work fine.) Here's a straight copy-and-paste comparison from psql:</div><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"><div><br></div><div><div>mydb=# INSERT INTO addresses ( account_id, territory_id, location ) VALUES ( 1, 0, ST_GeomFromText('POINT(-114.112534 50.895364)') ) RETURNING id;</div></div><div><div> id </div></div><div><div>-----</div></div><div><div> 333</div></div><div><div>(1 row)</div></div><div><div><br></div></div><div><div>INSERT 0 1</div></div><div><div>mydb=# INSERT INTO addresses ( account_id, territory_id, location ) VALUES ( 1, 0, ST_GeomFromText('POINT(-114.228869 51.152249)') ) RETURNING id;</div></div><div><div>The connection to the server was lost. Attempting reset: Failed.</div></div><div><div>!> </div></div><div><br></div></blockquote><div>Here's the table definition:</div><blockquote class="webkit-indent-blockquote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 40px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><div><br></div><div><div>CREATE TABLE public.addresses</div></div><div><div>(id serial NOT NULL,</div></div><div><div>account_id int NOT NULL,</div></div><div><div>territory_id int NOT NULL,</div></div><div><div>location GEOGRAPHY(POINT,4326),</div></div><div><div>PRIMARY KEY (id));</div></div><div><div>CREATE INDEX location ON addresses USING GIST (location);</div></div><div><br></div></blockquote><div>Strange right? FWIW, the queries are being generated programmatically by a script, so the error is not caused by a typo, since hundreds of other inserts work. Also, I've done a little research, two interesting findings:</div><div><br></div><div>1. All the multiplied coordinate values (abs(lat)*abs(lng)) of the SUCCESSFUL inserts are LOWER than the coordinates of failed query.</div><div><br></div><div>2. If I create the table without the index on location, the failed inserts suddenly work. So it seems the problem lies with the PostGIS updating the Index -- maybe it doesn't like the size of the values of the larger coordinates?</div><div><br></div><div>Anyway, if you have any ideas of what I can do to fix this, I would love to hear them. Thanks!</div><div><br></div><div>...Rene</div></body></html>