var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: addGeometryColumn problem
username - giselab
dbname - giselab
table name - countries
i created the country as follows :
giselab=> create table countries (id integer primary key, name varchar (20) not null);
it successfully created . Then i tried to add a geometry column to it as follows but i get the following error :
giselab=> select AddGeometryColumn ('giselab', 'countries', 'geom', -1, 'GEOMETRY', 2);
ERROR: Schema 'giselab' is not a valid schemaname
CONTEXT: SQL statement "SELECT AddGeometryColumn('', $1 , $2 , $3 , $4 , $5 , $6 )"
PL/pgSQL function "addgeometrycolumn" line 5 at SQL statement
i am using postgis 1.4.2 & postgres 8.4 on ubuntu.
what should i do ? all parametres passed to ddGeometryColumn seems correct. What is Schema , i thought its a Database name ?
pls help !!
Last edited by sachinites; 06-24-11 at 09:09.
Reason: missed some info
No, in PostgreSQL, a database can have multiple schemas, and every database has a 'public' schema by default.
Originally Posted by sachinites
PostgreSQL: Documentation: Manuals: PostgreSQL 8.4: Schemas
The AddGeometryColumn function has three signatures. The one you're using takes a schema name, so unless you've explicitly created your own schema for your tables, this would be 'public'.
However, the function defaults to the public schema, so you can just omit the schema name altogether:
select AddGeometryColumn ('public', 'countries', 'geom', -1, 'GEOMETRY', 2);
select AddGeometryColumn ('countries', 'geom', -1, 'GEOMETRY', 2);