[Gdal-dev] Using ogr2ogr -f PostgreSQL on Windows works now

Emil Zegers EZS at DeStraat.NL
Fri May 28 12:26:41 EDT 2004


Hello Frank,

Thanks for your reply (and sorry for mailing to the wrong list :-)

I've changed the syntax to:

ogr2ogr -f "PostgreSQL" PG:"user=ezs dbname=myGISdb host=localhost password=geheim port=5432" D:\klusjes\LVE\R2058\data\basis\shp\nl_gemeente.shp overwrite=yes

And now it works, thanks.

(Had to use 'overwrite=yes' because relation was already created I think)

Best regards,

Emil Zegers



Emil Zegers wrote:
> Hello,
> 
> i'm trying to use ogr2ogr together with the Win32 PostgreSQL 7.5/PostGIS snapshot from Mark Cave-Ayland (http://www.webbased.co.uk/mca/pgsql75win.zip)
> 
> But at the moment  end up at this error:
> 
> ERROR 1: PGconnectcb failed.
> could not create socket: Address family not supported (0x0000273F/10047)
> 
> The syntax I use is:
> 
> ogr2ogr -f "PostgreSQL" PG:user=ezs PG:dbname=myGISdb PG:host=localhost PG:password=geheim PG:port=5432 D:\klusjes\LVE\R2058\data\basis\shp\nl_gemeente.shp
> 
> Something seems to go wrong with connecting to the host.

Emil,

This is a quoting issue.  The whole dataset name needs to be a single
argument to ogr2ogr, so you have to quote it.

eg.
ogr2ogr -f PostgreSQL "PG:user=ezs PG:dbname=myGISdb PG:host=localhost PG:password=geheim PG:port=5432" \
    D:\klusjes\LVE\R2058\data\basis\shp\nl_gemeente.shp

I presume that because the PG:port=5432 was missing from the dataset name it
was unable to even connect to the database properly.

I would add that this is more of a GDAL/OGR issue than an OpenEV one, and might
be better discussed on that list.

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com 
light and sound - activate the windows | http://pobox.com/~warmerdam 
and watch the world go round - Rush    | Geospatial Programmer for Rent



______________________________________________________

 This message has been checked for all known viruses
______________________________________________________



More information about the Gdal-dev mailing list