[QGIS-trac] Re: [Quantum GIS] #2137: Wrong ID provided to the PostGIS on save

Quantum GIS qgis at qgis.org
Sun Nov 22 23:56:38 EST 2009


#2137: Wrong ID provided to the PostGIS on save
-----------------------------------------------------+----------------------
        Reporter:  fsat                              |         Owner:  nobody       
            Type:  bug                               |        Status:  new          
        Priority:  major: does not work as expected  |     Milestone:  Version 1.4.0
       Component:  Data Provider                     |       Version:  HEAD         
      Resolution:                                    |      Keywords:               
Platform_version:                                    |      Platform:  Gentoo       
        Must_fix:  No                                |   Status_info:  0            
-----------------------------------------------------+----------------------
Comment (by fsat):

 Schema is attached to the ticket, to populate it with sample data just
 execute the following statements.

 insert into maps (ID, NAME) values(1, "map1");
 insert into layers (ID, NAME, MAP_ID) values(1, "layer1", 1);

 -------------------------------------------------------------
 After that you can add LINESTRING layer in QGIS using view with name
 "map1_l1_l" and draw a line.
 And after that add POINT layer in QGIS using view with name "map1_l1_s"
 and reproduce my error.

 As you can see from section:

 query := 'create or replace rule '|| view_name || 'i ' || '
                 as on insert to '|| view_name || '
                 do instead (
                         insert into layer_elements (layer_id, id, name)
 values('|| lid ||', NEW.id, NEW.name);
                         insert into ' || le ||' (id, the_geom)
 values(NEW.id, NEW.the_geom);
                 )';

 The ID is not calculated automaticaly, I'm using the provided one, without
 defaults.

 PostGIS version - 1.4.0, Postgresql version - 8.2.14, QGIS version - 1.3.0

-- 
Ticket URL: <https://trac.osgeo.org/qgis/ticket/2137#comment:3>
Quantum GIS <http://qgis.org>
Quantum GIS is an Open Source GIS viewer/editor supporting OGR, PostGIS, and GRASS formats


More information about the QGIS-trac mailing list