[QGIS-trac] [Quantum GIS] #2553: QgsDataSourceURI.setSql() doesn't support LIMIT query string

Quantum GIS qgis at qgis.org
Sat Mar 13 07:05:07 EST 2010


#2553: QgsDataSourceURI.setSql() doesn't support LIMIT query string
------------------------------------------------+---------------------------
   Reporter:  brushtyler                        |              Owner:  nobody       
       Type:  bug                               |             Status:  new          
   Priority:  major: does not work as expected  |          Milestone:  Version 1.5.0
  Component:  Data Provider                     |            Version:  HEAD         
   Keywords:  qgsdatasourceuri, limit           |   Platform_version:               
   Platform:  Debian                            |           Must_fix:  No           
Status_info:  0                                 |  
------------------------------------------------+---------------------------
 Trying this (in python)
 {{{
 uri = qgis.core.QgsDataSourceURI()
 uri.setConnection(host, port, dbname, user, passwd)
 uri.setDataSource(schema, table, geom_column)
 uri.setSql('LIMIT 10')

 vl = qgis.core.QgsVectorLayer(uri.uri(), layername, "postgres")
 }}}
 terminal displays this error
 {{{
 row number 0 is out of range 0..-1
 }}}
 so this query returns no rows.

-- 
Ticket URL: <https://trac.osgeo.org/qgis/ticket/2553>
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