<html><div style='background-color:'><DIV class=RTE>
<P>I have in the file pg_hba.conf the following one it lines:</P>
<P>host    all         all         127.0.0.1/32          md5</P>
<P>and I have proven to not putting the password in the connection string but the result is the same one, that is to say, it doesn't work and it shows the same message:</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 dbname=pruebapostgis'. <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></DIV>
<DIV></DIV>
<BLOCKQUOTE style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #a0c6e5 2px solid; MARGIN-RIGHT: 0px"><FONT style="FONT-SIZE: 11px; FONT-FAMILY: tahoma,sans-serif">
<HR color=#a0c6e5 SIZE=1>

<DIV></DIV>From:  <I>Paul Scott <pscott@uwc.ac.za></I><BR>Reply-To:  <I>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>Sun, 16 Oct 2005 21:11:49 +0200</I><BR>>Have you checked your pg_hba.conf that the localhost or 127.0.0.1 entry<BR>>is a trusted user? If not try setting the ident part to trust and<BR>>restart the server.<BR>><BR>>--Paul<BR>><BR>>On Sun, 2005-10-16 at 18:55 +0000, Juan Barón wrote:<BR>> > I have pulled up postmaster with - i  and it continues without working<BR>> ><BR>> ><BR>> ><BR>> ><BR>> ><BR>> >         
______________________________________________________________<BR>> >         From:  Armin Burger <armin.burger@gmx.net><BR>> >         Reply-To:  PostGIS Users Discussion<BR>> >         <postgis-users@postgis.refractions.net><BR>> >         To:  PostGIS Users Discussion<BR>> >         <postgis-users@postgis.refractions.net><BR>> >         Subject:  Re: [postgis-users] Problem with mapserver-postgis<BR>> >         Date:  Sun, 16 Oct 2005 12:57:56 +0200<BR>> 
>         >Is postmaster started with the -i option (enable TCP/IP<BR>> >         >connections)?<BR>> >         ><BR>> >         >Armin<BR>> >         ><BR>> >         >Juan Barón wrote:<BR>> >         >>Hi:<BR>> >         >><BR>> >         >>I have changed the connection string writing the password:<BR>> >         >><BR>> >         >>CONNECTION 
"user=postgres password=postgres<BR>> >         dbname=pruebapostgis<BR>> >         >>host=localhost port=5432"<BR>> >         >><BR>> >         >>and I obtain the same result:<BR>> >         >><BR>> >         >>msDrawMap(): Image handling error. Failed to draw layer<BR>> >         named<BR>> >         >>'callejero'.<BR>> >         >>msPOSTGISLayerOpen(): Query error. couldnt make connection<BR>> 
>         to DB<BR>> >         >>with connect string 'user=postgres password=postgres<BR>> >         >>dbname=pruebapostgis host=localhost port=5432'.<BR>> >         >>Error reported was 'could not translate host name<BR>> >         "localhost" to<BR>> >         >>address: Unknown host '.<BR>> >         >>This error occured when trying to make a connection to the<BR>> >         >>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<BR>> >         its not<BR>> >         >>on 5432 you must specify a 'port=...'<BR>> >         >>(6) the security on your system 
does not allow the<BR>> >         webserver<BR>> >         >>(usually user 'nobody') to make socket connections to the<BR>> >         >>postmaster<BR>> >         >>(7) you forgot to specify a 'host=...' if the postmaster is<BR>> >         on a<BR>> >         >>different machine<BR>> >         >>(8) you made a typo<BR>> >         >><BR>> >         >>I have also proven to connect me to the db from the command<BR>> 
>         prompt<BR>> >         >>with the login information and I connect myself well:<BR>> >         >><BR>> >         >>psql  pruebapostgis  -U postgres<BR>> >         >><BR>> >         >>somebody knows which is the problem, it seems that it<BR>> >         doesn't<BR>> >         >>transfer localhost to an address, I have also proven with<BR>> >         127.0.0.1<BR>> >         
>>and neither it works<BR>> >         >><BR>> >         >><BR>> >         >><BR>> >         >><BR>> >         >><BR>> >         >>------------------------------------------------------------------------<BR>> >         >><BR>> >         >>     From:  /Prashanth Ram <pram123@gmail.com>/<BR>> >         >>     Reply-To:  /pram@pramcentral.com,PostGIS 
Users<BR>> >         Discussion<BR>> >         >>     <postgis-users@postgis.refractions.net>/<BR>> >         >>     To:  /PostGIS Users Discussion<BR>> >         >><postgis-users@postgis.refractions.net>/<BR>> >         >>     Subject:  /Re: [postgis-users] Problem with<BR>> >         mapserver-postgis/<BR>> >         >>     Date:  /Sat, 15 Oct 2005 17:47:06 -0400/<BR>> 
>         >><BR>> >         >>     Juan:<BR>> >         >>        Have you tried connecting to the db from the command<BR>> >         prompt<BR>> >         >>with<BR>> >         >>     the login information?<BR>> >         >>       Also, the connection string is missing the password<BR>> >         >><BR>> >         
>>     -Prashanth<BR>> >         >><BR>> >         >><BR>> >         >>     --     HTMLX.com<BR>> >         >>     Mapserver Hosting, Mapscript Hosting, PHP Hosting<BR>> >         >>     PostgreSQL w/PostGIS extension enabled Hosting<BR>> >         >><BR>> >         >>     On 10/15/05, *Juan Barón* <jbarong@hotmail.com<BR>> >         
>>     <mailto:jbarong@hotmail.com>> wrote:<BR>> >         >><BR>> >         >>Hello list,<BR>> >         >><BR>> >         >>I am using mapserver 4.4.1 and postgresql 8.0 with postgis.<BR>> >         >><BR>> >         >><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<BR>> >         >>host=localhost<BR>> >         >>         port=5432"<BR>> >         
>>             DATA "the_geom from tablacallejero"<BR>> >         >><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<BR>> >         doesn't<BR>> >         >>appear me         and the<BR>> >         >>         result is a message for screen:<BR>> >         >><BR>> 
>         >>         msDrawMap(): Image handling error. Failed to draw<BR>> >         layer<BR>> >         >>named<BR>> >         >>         'callejero'.<BR>> >         >><BR>> >         >>         msPOSTGISLayerOpen(): Query error. couldnt make<BR>> >         connection<BR>> >         >>to DB<BR>> >         
>>         with<BR>> >         >>         connect string 'user=postgres dbname=pruebapostgis<BR>> >         >>host=localhost<BR>> >         >>         port=5432'.<BR>> >         >>         Error reported was 'could not translate host name<BR>> >         >>"localhost" to<BR>> >         >>         address:<BR>> >         
>><BR>> >         >>         Unknown host '.<BR>> >         >>         This error occured when trying to make a connection<BR>> >         to the<BR>> >         >>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<BR>> >         connection<BR>> >         >>string<BR>> >         >><BR>> >         >>         (3) the postmaster (postgresql server) isnt running<BR>> >         >>         (4) you are not allowing TCP/IP connection to the<BR>> >         >>postmaster<BR>> >         
>>         (5) your postmaster is not running on the correct<BR>> >         port -<BR>> >         >>if its<BR>> >         >>         not on<BR>> >         >>         5432 you must specify a 'port=...'<BR>> >         >><BR>> >         >>         (6) the security on your system does not allow the<BR>> >         >>webserver<BR>> 
>         >>         (usually<BR>> >         >>         user 'nobody') to make socket connections to the<BR>> >         >>postmaster<BR>> >         >>         (7) you forgot to specify a 'host=...' if the<BR>> >         postmaster<BR>> >         >>is on a<BR>> >         >>         different<BR>> >         
>>         machine<BR>> >         >><BR>> >         >>         (8) you made a typo<BR>> >         >><BR>> >         >>         I have proven to change localhost for 127.0.0.1<BR>> >         >>         <http://127.0.0.1/>, but the result is the<BR>> >         >>         same one.<BR>> >         >><BR>> 
>         >>         postgresql this being executed, because if I put<BR>> >         netstat -<BR>> >         >>na<BR>> >         >>         appears:<BR>> >         >><BR>> >         >>         TCP 127.0.0.1:5432<BR>> >         <http://127.0.0.1:5432/>  LISTENING<BR>> >         >><BR>> >         
>>         I don't know which is the problem.<BR>> >         >><BR>> >         >>         Thank's<BR>> >         >><BR>> >         >><BR>> >         >><BR>> >         >><BR>> >         >>         _______________________________________________<BR>> >         >>         postgis-users mailing list<BR>> 
>         >>         postgis-users@postgis.refractions.net<BR>> >         >>         <mailto:postgis-users@postgis.refractions.net><BR>> >         >><BR>> >         >>http://postgis.refractions.net/mailman/listinfo/postgis-users<BR>> >         >><BR>> >         >><BR>> >         >><BR>> >         >><BR>> >         >><BR>> 
>         >><BR>> >         >>     --     HTMLX.com<BR>> >         >>     Mapserver Hosting, Mapscript Hosting, PHP Hosting<BR>> >         >>     PostgreSQL w/PostGIS extension enabled Hosting<BR>> >         >><BR>> >         >>      >_______________________________________________<BR>> >         >>      >postgis-users mailing list<BR>> 
>         >>      >postgis-users@postgis.refractions.net<BR>> >         >><BR>> >         >><BR>> >         >http://postgis.refractions.net/mailman/listinfo/postgis-users<BR>> >         >><BR>> >         >><BR>> >         >>------------------------------------------------------------------------<BR>> >         >><BR>> >         >>_______________________________________________<BR>> 
>         >>postgis-users mailing list<BR>> >         >>postgis-users@postgis.refractions.net<BR>> >         >>http://postgis.refractions.net/mailman/listinfo/postgis-users<BR>> >         >_______________________________________________<BR>> >         >postgis-users mailing list<BR>> >         >postgis-users@postgis.refractions.net<BR>> >         >http://postgis.refractions.net/mailman/listinfo/postgis-users<BR>> > _______________________________________________<BR>> > postgis-users mailing list<BR>> > 
postgis-users@postgis.refractions.net<BR>> > http://postgis.refractions.net/mailman/listinfo/postgis-users<BR>><BR>>_______________________________________________<BR>>postgis-users mailing list<BR>>postgis-users@postgis.refractions.net<BR>>http://postgis.refractions.net/mailman/listinfo/postgis-users<BR></FONT></BLOCKQUOTE></div></html>