[Qgis-developer] loading PostGIS layers

Ivan Mincik ivan.mincik at gista.sk
Wed Nov 24 06:20:57 EST 2010

On 11/23/2010 07:08 PM, cavallini at faunalia.it wrote:
> Sounds great, but:
> - it means duplicating work
> - it will to be kept in sync with upstream postgis changes
> - it does not allow writing sql dumps, useful for users without direct access to db.
> Thoughts?
> ---
> http://faunalia.it/pc
> ----- Reply message -----
> Da: "Martin Dobias"<wonder.sk at gmail.com>
> Data: mar, nov 23, 2010 18:54
> Oggetto: [Qgis-developer] loading PostGIS layers
> A:<cavallini at faunalia.it>
> Cc: "qgis-developer"<qgis-developer at lists.osgeo.org>
> Hi Paolo
> On Tue, Nov 23, 2010 at 4:35 PM, Paolo Cavallini<cavallini at faunalia.it>  wrote:
>> Hi all.
>> Currently, PostGIS Manager is an enormously useful tool. I would recommend its
>> inclusion in trunk. To be fully usable, however, users would need also the utility
>> shp2pgsql. AFAIK, this cannot be installed alone on windows, but apparently require
>> the installation of PostgreSQL and PostGIS (I may be wrong - I do not know Windows).
>> This is of course a major problem.
>> Could shp2pgsql be packaged in the standalone installer?
> IIRC our discussion at the hackfest, we have concluded that the best
> solution would be:
> 1. implement PostGIS import from any vector layer in core library
> 2. use that functionality in PostGIS manager + allow multi-file import
> This would avoid the necessity for shp2pgsql (pgsql2shp could be
> avoided too, by using QgsVectorFileWriter). Moreover, this would allow
> us to remove the buggy SPIT plugin, since all its functionality would
> be available from postgis manager.

I would vote for option number 1, since it would be much more cleaner 
way as to convert data to SHP and than catch output of some third party 
binary (shp2pgsql). And it can provide much more benefit (like exporting 
all supported vector formats, not only SHP ...).

- 'shp2pgsql '  has some limits coming out of Shapefile nature like 8 
character column name ...
- in some cases, You can get different/corrupted data when exporting to SHP
- 'shp2pgsql ' has some bugs, You should always keep latest version
- I am not sure about UTF8 support in DBF in all cases
- SHP is rather obsolete format and in general it  would be fine not to 
hard wire  export feature to it

Ivan Mincik, Gista s.r.o.

More information about the Qgis-developer mailing list