ERROR: column 'oid' does not exist

Tyler Mitchell tylermitchell at SHAW.CA
Thu Jun 22 18:26:07 EDT 2006


Hi Nigel,
Creating tables with or without OIDS is an option when creating  
tables, but you do not 'add' an oid column.
Instead when you create the table use:
CREATE TABLE tablename .... WITH OIDS;
So add WITH OIDS at the end of your create table statement.

If you want OIDS to be created by default, then I think there is a  
setting in your postmaster.conf file that will enable that.  Previous  
versions of postgresql added them by default but more recent versions  
(at least 8.1) turned them off by default.

Hope this helps,
Tyler

On 22-Jun-06, at 2:56 PM, Nigel Gilbert 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



More information about the mapserver-users mailing list