[OSM-dev] [OSM-Dev]Add Geometry Column in PostgreSQl

Jon Burgess jburgess777 at gmail.com
Fri Jul 9 22:28:58 BST 2010


>         
>         SELECT AddGeometryColumn('roads', 'geom', -1, 'GEOMETRY',2);
> 
> 
>    the error genrated by above query is:
>    SQL error:
> 
>      ERROR:  function addgeometrycolumn(unknown, unknown, integer, unknown, integer) does not exist
>      LINE 1: SELECT AddGeometryColumn('roads', 'geom', -1, 'GEOMETRY',2);
>                ^
>       HINT:  No function matches the given name and argument types. You might need to add explicit type casts.
> 
>       In statement:
> 
> 
>       SELECT AddGeometryColumn('roads', 'geom', -1, 'GEOMETRY',2); 

You would get that error if you have not loaded the postgis extension
into your database. You need to do something like this, where 'gis' is
the name of the database. This needs to be done as the 'postgres' user:

# for Ubuntu <=9.10:
  psql -d gis -f /usr/share/postgresql-8.3-postgis/lwpostgis.sql
# for Ubuntu >=10.04:
  psql -d gis -f /usr/share/postgresql/8.4/contrib/postgis.sql

For more details about how to setup a typical postgis-enabled DB see http://wiki.openstreetmap.org/wiki/Mapnik/PostGIS

	Jon






More information about the dev mailing list