ERROR: column 'oid' does not exist

Aaron Koning aaronkoning at GMAIL.COM
Thu Jun 22 23:50:56 EDT 2006


If you imported the spatial layer with shp2pgsql or OGR programs, their
should be a unique id field already (e.g. 'gid' with shp2pgsql). You can
tell MapServer to use this unique id field instead of oid in the LAYER ->
DATA variable of your MapFile.

Example:
     DATA "the_geom FROM roads AS foo USING UNIQUE gid"

Aaron


On 6/22/06, Nigel Gilbert <n.gilbert at surrey.ac.uk> wrote:
>
> I am trying to use mapserver with a PostGIS enabled database.  However, I
> get the mapserver error:
>
> prepare_database(): Query error. Error executing POSTGIS DECLARE (the
> actual
> query) statement: 'DECLARE mycursor BINARY CURSOR FOR SELECT
> asbinary(force_collection(force_2d(geom)),'XDR'),OID::text from world
> WHERE
> geom && setSRID('BOX3D(-1333.33333333333 -1000,1333.33333333333
> 1000)'::BOX3D, find_srid('','world','geom') )'
>
> Postgresql reports the error as 'ERROR: column "oid" does not exist '
>
> I then noticed that the documentation for PostGIS, section 4.7.1 says that
> I
> should create an oid index for the table I am wanting to display.  So,
> following the suggestion there, I tried, in the psql monitor:
>
> create index world_oid_index on world ( oid );
> ERROR:  column "oid" does not exist
>
> where 'world' is the table containing my geometry column.  I haven't found
> anything useful to help in either the PostGIS documenation or the
> PostgreSQL
> docs.
>
> What am I doing wrong?
>
> Many thanks for your help!
>
>
> --
> Nigel
>



-- 
+--------------------------------------------
|  Aaron Koning
|  Information Technologist
|  Prince George, BC, Canada.
+--------------------------------------------
|  http://datashare.gis.unbc.ca/fist/
|  http://datashare.gis.unbc.ca/gctp-js/
+--------------------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapserver-users/attachments/20060622/c991d497/attachment.html


More information about the mapserver-users mailing list