[Mapserver-west] postgis query size limit

Tyler Mitchell tylermitchell at shaw.ca
Fri May 13 09:47:15 EDT 2005


Ken-ichi,
Of course, your best bet would be to have this MapServer bug fixed, but in the 
meantime we can come up with all sorts of fun (?) ways around the problem :)

You could also try creating a custom function in PostgreSQL that takes care of 
the main SQL syntax, but allows you to feed it a few variables (like the list 
of id's).  That means you'd have to learn something like pl/pgsql.

Another approach might be, kind of what Dean mentioned, but without using db 
links.  You can write a custom function using other languages, like Python.  
I did this the other, where I put some Python code in a PostgreSQL function.  
I call the function like would any other, and the Python goes and does some 
stuff in my filesystem.  Very fun.  You could do something similar where 
Python goes out and queries for the view in the MySQL database and returns 
the list of ids to PostgreSQL.

I think I'm getting a bit carried away - but still trying to help :)

Tyler


On May 12, 2005 04:17 pm, Ken-ichi wrote:
> Hi all.  I've been having trouble using very long PostGIS queries within
> MapServer.  I found this year-old email on the same topic
>
> http://lists.gis.umn.edu/pipermail/mapserver-users/2004-February/010233.htm
>l
>
> and I was wondering if anyone knows if this problem has been fixed.
>
> My situation is as follows: I'm in an awkward bind in which all the
> non-spatial parts of a dataset reside in a MySQL database, and all the
> spatial stuff is in PostGIS.  When a user queries the MySQL db, they get
> back a bunch of unique record identifiers that can then be used to pull
> point data out of the PostGIS table by setting a really long WHERE
> clause (ie 'WHERE key=value1 OR key=value2 OR key=value3, etc).  All
> well and good, until I start trying to pull out more than about 400
> records.  Then MapServer chokes and I get a 500 error.
>
> If anyone can think of a better way around this problem, I'm all ears.
> Thanks.
>
> -Ken-ichi
>
> PS.  Anyone going to Open Source Geospatial '05?  I just registered.
> _______________________________________________
> Mapserver-west mailing list
> Mapserver-west at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/mapserver-west


More information about the Mapserver-west mailing list