[postgis-users] AddGeometryColumn => column does not exist

John Taber jtaber at johntaber.net
Fri Nov 18 19:24:57 PST 2005


Problem Solved. (it was in the readme)  Must Add:

$ createlang plpgsql newdb
$ pqsql -f /usr/share/postgresql/8.1/contrib/lwpostgis.sql -d newdb

then can run
$ psql newdb
# SELECT AddGeometryColumn('db'......);

John




Owen Jacobson wrote:
> John Taber wrote:
>  
> 
>>I've done a fresh install of 8.1 postgres/postgis.  I've done 
>>the following:
> 
> ...
> 
>># CREATE TABLE gtest(ID int4, NAME varchar(20));
>>CREATE TABLE
>># SELECT AddGeometryColumn("gtest","roads_geom",-1,"GEOMETRY",3);
>>ERROR: column "gtest" does not exist
>>
>>1) The tutorial and manual 4.2.3 use single quotes - my 
>>system chokes on 
>>that with quoted fields shown as unknown and the function 
>>doesn't match.
>>
>>2) I've tried both syntax shown in 4.2.3 (with and without 
>>schema name) 
>>and still get the column does not exist error. If the schema 
>>is put in 
>>as null ("") the system chokes with ERROR: zero length 
>>delimited... If 
>>put in as space (" ") then the column does not exist error appears.
>>
>>What is wrong here ?
> 
> 
> Double-quotes in an SQL query mark a field literal, not a string.  AddGeometryColumn takes strings (varchar, IIRC), not field literals.
> 
> Try:
> 
> # SELECT AddGeometryColumn ('gtest'::VARCHAR, 'roads_geom'::VARCHAR, -1, 'GEOMETRY'::VARCHAR, 3);
> 
> This shouldn't be necessary but I haven't used postGIS with postgresql 8.1 yet.
> 
> -Owen
> _______________________________________________
> 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