<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=us-ascii" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 10.00.9200.16635"></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=365032821-02082013><FONT color=#0000ff 
size=2 face=Arial>Try using a  trigger.  </FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=365032821-02082013><FONT color=#0000ff 
size=2 face=Arial><A 
href="http://www.postgresql.org/docs/9.1/static/sql-createtrigger.html">http://www.postgresql.org/docs/9.1/static/sql-createtrigger.html</A></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=365032821-02082013><FONT color=#0000ff 
size=2 face=Arial></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=365032821-02082013><FONT color=#0000ff 
size=2 face=Arial>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.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=365032821-02082013><FONT color=#0000ff 
size=2 face=Arial></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=365032821-02082013><FONT color=#0000ff 
size=2 face=Arial>Hope that helps,</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=365032821-02082013><FONT color=#0000ff 
size=2 face=Arial>Regina</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=365032821-02082013><FONT color=#0000ff 
size=2 face=Arial><A 
href="http://www.postgis.us">http://www.postgis.us</A></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=365032821-02082013><FONT color=#0000ff 
size=2 face=Arial><A 
href="http://www.paragoncorporpation.com">http://www.paragoncorporpation.com</A></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=365032821-02082013><FONT color=#0000ff 
size=2 face=Arial></FONT></SPAN> </DIV><BR>
<DIV lang=en-us class=OutlookMessageHeader dir=ltr align=left>
<HR tabIndex=-1>
<FONT size=2 face=Tahoma><B>From:</B> postgis-users-bounces@lists.osgeo.org 
[mailto:postgis-users-bounces@lists.osgeo.org] <B>On Behalf Of 
</B>BladeOfLight16<BR><B>Sent:</B> Thursday, August 01, 2013 5:19 
PM<BR><B>To:</B> Melin Maxence; PostGIS Users Discussion<BR><B>Subject:</B> Re: 
[postgis-users] Link beween the_geom of 2 tables<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV class=gmail_quote>On Thu, Jul 18, 2013 at 11:15 AM, Melin Maxence <SPAN 
dir=ltr><<A href="mailto:maxencemelin@yahoo.fr" 
target=_blank>maxencemelin@yahoo.fr</A>></SPAN> wrote: 
<BLOCKQUOTE class=gmail_quote 
style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
  <DIV>
  <DIV style="FONT-SIZE: 12pt; FONT-FAMILY: arial,helvetica,sans-serif">
  <DIV 
  style="FONT-SIZE: 16px; FONT-FAMILY: arial,helvetica,sans-serif; FONT-STYLE: normal; BACKGROUND-COLOR: transparent">Do 
  you know if it is possible to have in the_geom field of one record in a table 
  A, a link (query, hypertext, something else...) to the_geom field of another 
  record in a different table (table B), so that when the geom is modified in 
  the record of the table A, it is automatically modified in the related record 
  of the table B ?</DIV></DIV></DIV></BLOCKQUOTE>
<DIV><BR>It sounds like you need <A 
href="http://www.postgresql.org/docs/9.2/static/tutorial-fk.html">foreign 
keys</A>. You can then obtain the geometry using a JOIN as Rich mentioned. 
Whether A should reference B or vice versa or it's appropriate to have a 
separate table would depend on the particular situation. That said, this is only 
the case if the geometries in the table are supposed to be identical. If what 
you're really after is to clip a geometry or something of that nature, I imagine 
a topology might be more suited to your needs, but you could potentially 
accomplish such modification with triggers as Rich 
mentioned.<BR></DIV></DIV></BODY></HTML>