[postgis-users] create spatial table problem

Kralidis,Tom [Burlington] Tom.Kralidis at ec.gc.ca
Tue Feb 21 09:20:05 PST 2006


Thanks for the advice.  This worked when I indexed on id instead of oid.

Thanks

..Tom


> -----Original Message-----
> From: postgis-users-bounces at postgis.refractions.net 
> [mailto:postgis-users-bounces at postgis.refractions.net] On 
> Behalf Of Robert Burgholzer
> Sent: Tuesday, February 21, 2006 12:17 PM
> To: PostGIS Users Discussion
> Subject: RE: [postgis-users] create spatial table problem
> 
> 
> 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
> _______________________________________________
> 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