Cheers Richard! Your two suggestions fixed the problem. Here is the resultant working command:<br> <br> ogr2ogr -f KML kmltest.kml "PG:dbname=postgis user=postgres password=pword host=localhost" -sql "SELECT * FROM district;"<br> <br> Brent Edwards<br> Montreal, QC<br> <br> <br><br><b><i>Richard Matsunaga <richard.matsunaga@waypointinfo.com></i></b> wrote:<blockquote class="replbq" style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"> <meta http-equiv="Content-Type" content="text/html; charset=us-ascii"> <meta content="MSHTML 6.00.5730.11" name="GENERATOR"> <div align="left" dir="ltr"><font color="#0000ff" face="Arial" size="2"><span class="481141221-03012007">Try 'user=postgres' instead. You may need a 'host=' in there as well.</span></font></div> <div align="left" dir="ltr"><font color="#0000ff" face="Arial" size="2"><span class="481141221-03012007"></span></font> </div> <div align="left" dir="ltr"><font
color="#0000ff" face="Arial" size="2"><span class="481141221-03012007">Richard</span></font></div><br> <div class="OutlookMessageHeader" align="left" dir="ltr" lang="en-us"> <hr tabindex="-1"> <font face="Tahoma" size="2"><b>From:</b> gdal-dev-bounces@lists.maptools.org [mailto:gdal-dev-bounces@lists.maptools.org] <b>On Behalf Of </b>Brent Edwards<br><b>Sent:</b> January 3, 2007 3:16 PM<br><b>To:</b> gdal-dev@lists.maptools.org<br><b>Subject:</b> [Gdal-dev] Newbie queston concerning ogr2ogr for PostgreSQL<br></font><br></div> <div></div>Why won't this work?:<br><br>ogr2ogr -f KML kmltest.kml "PG:dbname=postg<br>is username=postgres password=pword" -sql "SELECT * FROM district;"<br><br>ERROR 1: PQconnectdb failed.<br>invalid connection option "username"<br><br>FAILURE:<br>Unable to open datasource `PG:dbname=postgis username=postgres password=pword' w<br>ith the following drivers.<br> -> ESRI Shapefile<br> -> MapInfo File<br>
-> UK .NTF<br> -> SDTS<br> -> TIGER<br> -> S57<br> -> DGN<br> -> VRT<br> -> AVCBin<br> -> REC<br> -> Memory<br> -> CSV<br> -> GML<br> -> KML<br> -> Interlis 1<br> -> Interlis 2<br> -> SQLite<br> -> ODBC<br> -> PGeo<br> -> OGDI<br> -> PostgreSQL<br> -> MySQL<br><br> <div>__________________________________________________<br>Do You Yahoo!?<br>Tired of spam? Yahoo! Mail has the best spam protection around <br>http://mail.yahoo.com </div></blockquote><br><p> __________________________________________________<br>Do You Yahoo!?<br>Tired of spam? Yahoo! Mail has the best spam protection around <br>http://mail.yahoo.com