[postgis-users] create spatial table problem

Robert Burgholzer rburghol at chesapeakebay.net
Tue Feb 21 09:17:28 PST 2006


The problem does not seem to be your spatial table per se, it is your
trying to create an index on OID, which it seems not to like. Since you
are creating a serial column, id, why not index on that? (Or is that
what you were trying to do and got a typo?)

r.b.

-----Original Message-----
From: postgis-users-bounces at postgis.refractions.net
[mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of
Kralidis,Tom [Burlington]
Sent: Tuesday, February 21, 2006 12:10 PM
To: postgis-users
Subject: [postgis-users] create spatial table problem


Hi,

I'm trying to create a spatial table with:

create table hydromet_stations (
        id serial primary key,
        stnid text,
        portfurl text,
        graphurl text,
        sensormlurl text,
        organization text
);

select AddGeometryColumn('hydromet_stations','the_geom',4326,'POINT',2);

create index hydromet_stations_idx ON hydromet_stations USING GIST (
the_geom GIST_GEOMETRY_OPS );
create index hydromet_stations_idx_oid ON hydromet_stations ( oid );

...which gives me an error:

devgeodb2=# \i create_table2.sql
psql:create_table2.sql:9: NOTICE:  CREATE TABLE will create implicit
sequence "hydromet_stations_id_seq" for seri
al column "hydromet_stations.id"
psql:create_table2.sql:9: NOTICE:  CREATE TABLE / PRIMARY KEY will
create implicit index "hydromet_stations_pkey"
 for table "hydromet_stations"
CREATE TABLE
                                   addgeometrycolumn
------------------------------------------------------------------------
----------------
 public.hydromet_stations.the_geom SRID:4326 TYPE:POINT DIMS:2
 geometry_column fixed:0
(1 row)

CREATE INDEX
psql:create_table2.sql:14: ERROR:  column "oid" does not exist
devgeodb2=# delete from geometry_columns where f_table_name =
'hydromet_stations';
DELETE 1
devgeodb2=# drop table hydromet_stations ;

devgeodb2=# select postgis_version();
            postgis_version
---------------------------------------
 1.1 USE_GEOS=1 USE_PROJ=1 USE_STATS=1
(1 row)

Any advice would be much appreciated.

Thanks

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



More information about the postgis-users mailing list