[postgis-users] PostGIS and updating table through a view

Fred Lehodey lehodey at gmail.com
Fri Dec 9 03:06:27 PST 2011


Hi,
you just need something like:

CREATE RULE maj_sites AS ON UPDATE TO "vue-sites" DO INSTEAD UPDATE sites
SET the_geom=NEW.the_geom WHERE gid=OLD.gid;

Fred.


On Fri, Dec 9, 2011 at 10:46 AM, Thierry Gonon <thierry.gonon at chronoterre.fr
> wrote:

> Hi all,
>
> My problem is the following :
> I use a view joining 2 tables, one for the geometry, the other for the
> data (due to the fact that datas are changed regularly by another process,
> through a DUMPALL)
>
> When (in QGIS) I change the geometry of a vector, it doesn't work, asking
> me for a rule...
> I've created the following rule :
> CREATE RULE maj_sites AS ON UPDATE TO "vue-sites" DO INSTEAD UPDATE sites
> SET the_geom=NEW.the_geom;
> My problem lies in writing the WHERE condition, because, actually, the
> rule put every vector with the same geometry.
> During the same edition session, I'll have to change (create or modify)
> several vectors...
>
> Any idea that can help ?
> It's probably a tricky thing, but didn't find the way...
>
> Thierry Gonon
> OA Méditerranée
> Direct number / Numéro direct : 00 33 4 86 87 02 29
> Extension : 1829
>
> Files attached to this email may be in ISO 26300 format (OASIS Open
> Document Format). If you have difficulty opening them, please visit
> http://iso26300.info for more information.
>
> This email has been processed by SmoothZap - www.smoothwall.net
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20111209/55c5ce01/attachment.html>


More information about the postgis-users mailing list