<html><div style='background-color:'><DIV class=RTE>
<P>Hi:</P>
<P>I have changed the connection string writing the password:</P>
<P>CONNECTION "user=postgres password=postgres dbname=pruebapostgis host=localhost port=5432"</P>
<P>and I obtain the same result:</P>
<P>msDrawMap(): Image handling error. Failed to draw layer named 'callejero'. <BR>msPOSTGISLayerOpen(): Query error. couldnt make connection to DB with connect string 'user=postgres password=postgres dbname=pruebapostgis host=localhost port=5432'. <BR>Error reported was 'could not translate host name "localhost" to address: Unknown host '. <BR>This error occured when trying to make a connection to the specified postgresql server. <BR>Most commonly this is caused by <BR>(1) incorrect connection string <BR>(2) you didnt specify a 'user=...' in your connection string <BR>(3) the postmaster (postgresql server) isnt running <BR>(4) you are not allowing TCP/IP connection to the postmaster <BR>(5) your postmaster is not running on the correct port - if its not on 5432 you must specify a 'port=...' <BR>(6) the security on your system does not allow the webserver (usually user 'nobody') to make 
socket connections to the postmaster <BR>(7) you forgot to specify a 'host=...' if the postmaster is on a different machine<BR>(8) you made a typo<BR><BR></P>
<P>I have also proven to connect me to the db from the command prompt with the login information and I connect myself well:</P>
<P>psql  pruebapostgis  -U postgres</P>
<P>somebody knows which is the problem, it seems that it doesn't transfer localhost to an address, I have also proven with 127.0.0.1 and neither it works</P>
<P> </P>
<P><FONT style="FONT-SIZE: 11px; FONT-FAMILY: tahoma,sans-serif"> </P>
<P>
<HR color=#a0c6e5 SIZE=1>
</P></DIV>
<BLOCKQUOTE style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #a0c6e5 2px solid; MARGIN-RIGHT: 0px">
<DIV></DIV>From:  <I>Prashanth Ram <pram123@gmail.com></I><BR>Reply-To:  <I>pram@pramcentral.com,PostGIS Users Discussion <postgis-users@postgis.refractions.net></I><BR>To:  <I>PostGIS Users Discussion <postgis-users@postgis.refractions.net></I><BR>Subject:  <I>Re: [postgis-users] Problem with mapserver-postgis</I><BR>Date:  <I>Sat, 15 Oct 2005 17:47:06 -0400</I><BR>
<DIV></DIV><BR>Juan:<BR>
<DIV></DIV>   Have you tried connecting to the db from the command prompt with the login information?<BR>
<DIV></DIV>  Also, the connection string is missing the password <BR>
<DIV></DIV><BR>
<DIV></DIV>-Prashanth<BR>
<DIV></DIV><BR>
<DIV></DIV><BR>
<DIV></DIV>-- <BR>
<DIV></DIV>HTMLX.com<BR>
<DIV></DIV>Mapserver Hosting, Mapscript Hosting, PHP Hosting<BR>
<DIV></DIV>PostgreSQL w/PostGIS extension enabled Hosting<BR><BR>
<DIV><SPAN class=gmail_quote>On 10/15/05, <B class=gmail_sendername>Juan Barón</B> <<A href="mailto:jbarong@hotmail.com">jbarong@hotmail.com</A>> wrote:</SPAN> </DIV>
<BLOCKQUOTE class=gmail_quote style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex">
<DIV>
<DIV><PRE>Hello list,<BR><BR>I am using mapserver 4.4.1 and postgresql 8.0 with postgis.
</PRE></DIV><BR><BR>I have a layer in the map file:<BR><BR>LAYER<BR>  CONNECTIONTYPE postgis<BR>    NAME callejero<BR>    CONNECTION "user=postgres dbname=pruebapostgis host=localhost<BR>port=5432"<BR>    DATA "the_geom from tablacallejero" </DIV><BR>    STATUS DEFAULT<BR>    TYPE LINE<BR>    CLASS<BR>     COLOR 255 0 0<BR>    END<BR>END<BR><BR>and when I execute the application, the layer doesn't appear me  and the<BR>result is a message for screen:<BR><BR>msDrawMap(): Image handling error. Failed to draw layer named 'callejero'.
<DIV></DIV><BR>msPOSTGISLayerOpen(): Query error. couldnt make connection to DB with<BR>connect string 'user=postgres dbname=pruebapostgis host=localhost<BR>port=5432'.<BR>Error reported was 'could not translate host name "localhost" to address:
<DIV></DIV><BR>Unknown host '.<BR>This error occured when trying to make a connection to the specified<BR>postgresql server.<BR>Most commonly this is caused by<BR>(1) incorrect connection string<BR>(2) you didnt specify a 'user=...' in your connection string
<DIV></DIV><BR>(3) the postmaster (postgresql server) isnt running<BR>(4) you are not allowing TCP/IP connection to the postmaster<BR>(5) your postmaster is not running on the correct port - if its not on<BR>5432 you must specify a 'port=...'
<DIV></DIV><BR>(6) the security on your system does not allow the webserver (usually<BR>user 'nobody') to make socket connections to the postmaster<BR>(7) you forgot to specify a 'host=...' if the postmaster is on a different<BR>machine
<DIV></DIV><BR>(8) you made a typo<BR><BR>I have proven to change localhost for <A href="http://127.0.0.1/">127.0.0.1</A>, but the result is the<BR>same one.<BR><BR>
<DIV></DIV>postgresql this being executed, because if I put netstat - na appears:<BR><BR>TCP <A href="http://127.0.0.1:5432/">127.0.0.1:5432</A>  LISTENING<BR><BR>
<DIV></DIV>I don't know which is the problem.<BR><BR>Thank's<PRE></PRE>
<DIV></DIV>
<DIV></DIV></BLOCKQUOTE>
<DIV><BR></DIV> 
<DIV></DIV><BR>
<BLOCKQUOTE class=gmail_quote style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex">_______________________________________________<BR>postgis-users mailing list<BR>
<DIV></DIV><A href="mailto:postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</A><BR><A href="http://postgis.refractions.net/mailman/listinfo/postgis-users">
<DIV></DIV>http://postgis.refractions.net/mailman/listinfo/postgis-users</A><BR><BR><BR><BR clear=all></BLOCKQUOTE>
<DIV></DIV><BR><BR clear=all><BR>-- <BR>HTMLX.com<BR>Mapserver Hosting, Mapscript Hosting, PHP Hosting<BR>PostgreSQL w/PostGIS extension enabled Hosting
<DIV></DIV>
<DIV></DIV><BR>
<P>>_______________________________________________<BR>>postgis-users mailing list<BR>>postgis-users@postgis.refractions.net<BR>>http://postgis.refractions.net/mailman/listinfo/postgis-users<BR>
<P></FONT></P></BLOCKQUOTE></div></html>