[postgis-users] MapServer dies when trying to view a layergenerated with PostGIS

Mark Cave-Ayland m.cave-ayland at webbased.co.uk
Fri Nov 25 00:35:00 PST 2005


> -----Original Message-----
> From: postgis-users-bounces at postgis.refractions.net [mailto:postgis-users-
> bounces at postgis.refractions.net] On Behalf Of Nicolas Ribot
> Sent: 24 November 2005 18:28
> To: PostGIS Users Discussion
> Subject: Re: [postgis-users] MapServer dies when trying to view a
> layergenerated with PostGIS
> 
> Hello Carlo,
> 
> New version of Postgresql (8.1) does not create OID column by default
> when creating a table (oid is globally unique identifiers used by
> Postgresql and also used by Mapserver to uniquely identify a row of
> result).
> 
> My solution was to enable oid-generation in postgresql, by editing the
> postgresql.conf (in the postgresql/8.1/data folder)
> Search for "default_with_oids", uncomment the line and set the
> variable value to "on".
> Then, regenerate your postgis tables.
> 
> I'm pretty sur you could also modify existing tables to add the oid
> column, though I don't know if it will work.
> 
> With the method above, newly created tables will have the shadow OID
> column added.
> 
> HTH.
> Nicolas


Hi Nicolas/Carlo,

Bear in mind that OID columns have been removed from tables for a reason;
mainly because they take up extra space on your hard disk but also because
OIDs are limited to 32 bits and PostgreSQL must be able to use them
internally otherwise a lot of things will break.

Instead of reloading the database, the easiest option is to modify your
mapserver DATA clause to read "the_geom from bc_voting_areas using unique
<id>" where <id> is the name of your primary key column.


Kind regards,

Mark. 

------------------------
WebBased Ltd
17 Research Way
Plymouth
PL6 8BT

T: +44 (0)1752 797131
F: +44 (0)1752 791023

http://www.webbased.co.uk   
http://www.infomapper.com
http://www.swtc.co.uk  

This email and any attachments are confidential to the intended recipient
and may also be privileged. If you are not the intended recipient please
delete it from your system and notify the sender. You should not copy it or
use it for any purpose nor disclose or distribute its contents to any other
person.





More information about the postgis-users mailing list