[Qgis-developer] Limited number of rows in a postgis layer

Giuseppe Sucameli brush.tyler at gmail.com
Tue Mar 9 07:59:08 EST 2010


Hi guys,

I've some table with geometry in a postgreSQL db
and I want to show a preview of them.

I've used QgsDataSourceURI and QgsVectorLayer,
but I would get from db a limited number of rows.

So I tried this (in python):

uri = qgis.core.QgsDataSourceURI()
uri.setConnection(host, port, dbname, user, passwd)
uri.setDataSource(schema, table, geom_column)
uri.setSql('LIMIT 10')

but it doesn't work fine because the sql can be
only a condition.

Anyone can help me? Do you have any idea about this?

Cheers

-- 
Giuseppe Sucameli
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/qgis-developer/attachments/20100309/f84be9ce/attachment.html


More information about the Qgis-developer mailing list