[postgis-users]CONNECTION to database thru Mapserver

w m wokar1 at yahoo.com
Mon Mar 14 14:42:32 PST 2005


Thank You Doug and Ethan:)
The connection is fine now. there were some things that did needed to be changed in the configuration files.
 
Now I get the error below. I did some  search and I think that I would have to upgrade postgis, is it true?
 
msDrawMap(): Image handling error. Failed to draw layer named 'Hotspots'. 
prep_DB(): Query error. Error executing POSTGIS DECLARE (the actual query) statement: 'DECLARE mycursor BINARY CURSOR FOR SELECT asbinary(force_collection(force_2d()),'NDR'),OID::text from WHERE && setSRID('BOX3D(-73.992437 45.0227318333333,-73.174263 45.9772681666667)'::BOX3D, find_srid('','','') )' 

Postgresql reports the error as 'ERROR: syntax error at or near "WHERE" at character 104 '

More Help:

Error with POSTGIS data variable. You specified '<check your .map file>'.
Standard ways of specifiying are : 
(1) 'geometry_column from geometry_table' 
(2) 'geometry_column from (<sub query>) as foo using unique <column name> using SRID=<srid#>' 

Make sure you put in the 'using unique <column name>' and 'using SRID=#' clauses in. 

For more help, please see http://postgis.refractions.net/documentation.php 

Mappostgis.c - version of Jan 23/2004. 
msPOSTGISLayerParseData(): Query error. Error parsing POSTGIS data variable. Must contain 'geometry_column from table_name' or 'geom from (subselect) as foo' (couldnt find ' from '). More help: 

Error with POSTGIS data variable. You specified 'the_geom FROM Hotspots'.
Standard ways of specifiying are : 
(1) 'geometry_column from geometry_table' 
(2) 'geometry_column from (<sub query>) as foo using unique <column name> using SRID=<srid#>' 

Make sure you put in the 'using unique <column name>' and 'using SRID=#' clauses in. 

For more help, please see http://postgis.refractions.net/documentation.php 

Mappostgis.c - version of Jan 23/2004. 


Ethan Alpert <ealpert at digitalglobe.com> wrote:
Maybe there's a case sensitivity problem. Try using all lower case for your db name.
 
-e

-----Original Message-----
From: postgis-users-bounces at postgis.refractions.net [mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of w m
Sent: Monday, March 14, 2005 2:33 PM
To: PostGIS Users Discussion
Subject: Re: [postgis-users]CONNECTION to database thru Mapserver


the configuration files are fine and they allow the connections....but  still to no avail after changing STATUS to DEFAULT i still get the same errors.  if i change STATUS to ON i dont see the points on the map but tehre are no errors.....

Doug_Newcomb at fws.gov wrote: 
Wokar,
Check your postgresql.conf file to see if you are allowing tcp/ip
connections and your pg_hba.conf file to see if you are allowing
connections from 132.205.108.60

Doug

Doug Newcomb
USFWS
Raleigh, NC
919-856-4520 ext. 14 doug_newcomb at fws.gov
---------------------------------------------------------------------------------------------------------

The opinions I express are my own and are not representative of the
official policy of the U.S.Fish and Wildlife Service or Dept. of Interior.
I left my signature file in /dev/null


|---------+--------------------------------------------->
| | w m |
| | Sent by: |
| | postgis-users-bounces at postgis.refr|
| | actions.net |
| | |
| | |
| | 03/14/2005 02:12 PM |
| | Please respond to PostGIS Users |
| | Discussion |
| | |
|---------+--------------------------------------------->
>---------------------------------------------------------------------------------------------|
| |
| To: PostGIS Users Discussion 
|
| cc: |
| Subject: Re: [postgis-users]CONNECTION to database thru Mapserver |
>---------------------------------------------------------------------------------------------|




Thanks for your reply. when I changed my STAUS to Default it gives me the
following error:

msDrawMap(): Image handling error. Failed to draw layer named 'Hotspots'.
msPOSTGISLayerOpen(): Query error. couldnt make connection to DB with
connect string 'user=project password=test dbname=Montreal
host=132.205.108.60'.
Error reported was 'could not connect to server: Connection refused Is the
server running on host "132.205.108.60" and accepting TCP/IP connections on
port 5432? '.
This error occured whe n trying to make a connection to the specified
postgresql server.
Most commonly this is caused by
(1) incorrect connection string
(2) you didnt specify a 'user=...' in your connection string
(3) the postmaster (postgresql server) isnt running
(4) you are not allowing TCP/IP connection to the postmaster
(5) your postmaster is not running on the correct port - if its not on 5432
you must specify a 'port=...'
(6) the security on your system does not allow the webserver (usually user
'nobody') to make socket connections to the post master
(7) you forgot to specify a 'host=...' if the postmaster is on a different
machine
(8) you made a typo
My server is running, what I am not sure is (4) and (5). Can you please
explain me how can I check the above. Also the user name and password is
the user name and password for the database right?



pram at pramcentral.com wrote:

----- Original Message -----
From: "w m"
To: "PostGIS Users Discussion"
Subject: Re: [postgis-users]CONNECTION to database thru Mapserver
Date: Mon, 14 Mar 2005 09:02:56 -0800 (PST)

>
> Thank You for your response.
> i made the changes that you suggested but i still have no luck in
> displaying the points on the map. I'm not sure if a connection is
> being established to the database or not...how can i know that??
> and instead of local host i also tried to insert the ip address of
> my server but it still didnt work nor did i get any errors.
> any help would be appreciated greately
> thank you
> wokar
>
> LAYER
> CONNECTIONTYPE postgis
> NAME "Spots" # my table name
> CONNECTION "user=test password=test dbname=MyDataBase host=localhost"
> DATA "the_geom FROM Spots" # the_geom column from table Spots
> STATUS ON
> TYPE POINT
> CLASS
> COLOR 0 0 0
> OUTLINECOLOR 0 0 0
> SIZE 2
> END
> ; END
>
Have you tried with STATUS DEFAULT instead of STATUS ON

-Prashanth
--
HTMLX.com
Mapserver, Mapscript, PHP Hosting


_______________________________________________
postgis-users mailing list
postgis-users at postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com _______________________________________________
postgis-users mailing list
postgis-users at postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users









_______________________________________________
postgis-users mailing list
postgis-users at postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users



---------------------------------
Do you Yahoo!?
Yahoo! Small Business - Try our new resources site! 
		
---------------------------------
Do you Yahoo!?
 Yahoo! Small Business - Try our new resources site! 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20050314/c86b660a/attachment.html>


More information about the postgis-users mailing list