[Qgis-user] QGIS can't save deleted features on a POSTGIS view

Poltini Roberto Roberto.Poltini at irenacquagas.it
Wed Jul 17 02:31:54 PDT 2013


Hi,
   i'am using QGIS to manage postgis data. I have one table containig geometry data and one table containing alfanumeric data. The two tables are linked together by a view. I created a rule on the view because I need to call a function during the delete event.
here an example:
CREATE OR REPLACE RULE my_rule_del AS
    ON DELETE TO my_view DO INSTEAD SELECT my_func();

QGIS reads and modifies data on the view "my_view".
When the QGIS user deletes some features and than try to save, an error is generated. QGIS tries to execute an sql statement "DELETE FROM my_view WHERE ..." which returns something unexpected by QGIS.

Using postgresql 8.4 it works well. The problem is generaed only using postgresql 9.

if I use the following rule:
CREATE OR REPLACE RULE my_rule_del AS
    ON DELETE TO my_view DO INSTEAD DELETE FROM my_table WHERE ...;

It works fine in both postgresql version.
I think that the problem is due to what is returned by the rule. Calling a function in the rule I need to use "SELECT my_func()" SQL statement which returns to QGIS a recordset or something different from what is returned by DELETE SQL statement.
How can I control the value returned by the rule ?

Thanks in advance.
Poltini Roberto

________________________________
Il Gruppo Iren La invita a prendere visione del Bilancio di Sostenibilita' 2012 (http://www.gruppoiren.it/bilancio_sfogliabile/index.html) e a visitare la sezione Sostenibilit? del sito internet di Gruppo (http://www.gruppoiren.it/sostenibilita.asp). Con tali strumenti la Societa' intende intensificare i rapporti con i propri stakeholder attraverso un canale di comunicazione chiaro e trasparente.

Le informazioni contenute nella presente comunicazione e i relativi allegati possono essere riservate e sono, comunque, destinate esclusivamente alle persone o alla Societ? sopraindicati. La diffusione, distribuzione e/o copiatura del documento trasmesso da parte di qualsiasi soggetto diverso dal destinatario ? proibita, sia ai sensi dell'art. 616 c.p. , che ai sensi del D.Lgs. n. 196/2003. Se avete ricevuto questo messaggio per errore, vi preghiamo di distruggerlo e di informare immediatamente il mittente.
________________________________
Iren is pleased to announce the Sustainability Report 2012 at http://www.gruppoiren.it/bilancio_sfogliabile/index.html. We invite you to visit the Sustainability website at http://www.gruppoiren.it/sostenibilita.asp. Sustainability Report is a part of our strategy for building trustful relationships with stakeholders.

The information in this e-mail (which includes any files transmitted with it) is confidential and may also be legally privileged. It is intended for the addressee only. Access to this e-mail by anyone else is unauthorised. It is not to be relied upon by any person other than the addressee, except with our prior written approval. If no such approval is given, we will not accept any liability (in negligence or otherwise) arising from any third party acting. Unauthorised recipients are required to maintain confidentiality. If you have received this e-mail in error please notify us immediately, destroy any copies and delete it from your computer system. Any use, dissemination, forwarding, printing or copying of this e-mail is prohibited.
________________________________
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20130717/b6db3e3e/attachment.html>


More information about the Qgis-user mailing list