[postgis-users] Size of .dbf file produced with pgsql2shp

Mark Cave-Ayland mark.cave-ayland at siriusit.co.uk
Wed Sep 1 10:29:56 PDT 2010


strk wrote:

>> Checking the resulting file size is not the right way to be trying to 
>> detect whether the query returned > 0 rows. It strikes me that the best 
>> way to detect this would be to return a different exit code from 
>> pgsql2shp if no rows are returned - would this work for you?
> 
> I'd go stricter to "if an ERROR occurred" rather than 
> "if no rows are returned".
> 
> Just in case one day we'll add a flag to specify the geometry type
> thus allowing creation of empty-but-structuted shapefiles starting
> from a table "template".
> 
> --strk;

This is exactly how the new code in trunk currently works - you get an 
exit code of 0 to indicate success, and an exit code of 1 if an error 
occurred. I was thinking of adding a new exit code of 2 to indicate 
success, but also that 0 records were processed.


ATB,

Mark.

-- 
Mark Cave-Ayland - Senior Technical Architect
PostgreSQL - PostGIS
Sirius Corporation plc - control through freedom
http://www.siriusit.co.uk
t: +44 870 608 0063

Sirius Labs: http://www.siriusit.co.uk/labs



More information about the postgis-users mailing list