[postgis-users] Link beween the_geom of 2 tables

BladeOfLight16 bladeoflight16 at gmail.com
Fri Aug 2 15:17:04 PDT 2013


On Fri, Aug 2, 2013 at 5:39 PM, Paragon Corporation <lr at pcorp.us> wrote:

> **
> Try using a  trigger.
> http://www.postgresql.org/docs/9.1/static/sql-createtrigger.html
>
> A foreign key won't work since it requires a btree primary key unless you
> use a btree primarky key on geometry, which at best would only work for
> points.
>

Apparently, I was unclear. I meant a foreign key to the primary key on the
other table, which I presume is not a geometry. My point was: if the
geometries are always duplicates of each other, there's no point in storing
them twice. If that's the case, pick a table, remove its geometry column,
and add a foreign key to the other table. When you need the geometry on the
table that no longer stores it, JOIN it to the other table to get the
geometry.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20130802/bd4fb055/attachment.html>


More information about the postgis-users mailing list