[postgis-users] Difficulty importing example file nyc_buildings.sql

bac at brucecallander.com bac at brucecallander.com
Mon Aug 15 03:28:27 PDT 2011


I am following the Geoserver Getting Started documentation in order to create an example PostGIS table.

I am working on a MacBook running Snow Leopard v10.6.8

Thanks to previous advice from the forum (Nicolas Ribot) I was able to create the sample database 'nyc' based on the template 'template_postgis'.

I am now encountering errors in trying to move to the next stage of importing the file 'nyc_buildings.sql' into the database.

The Unix command I am using is:

$ /usr/local/pgsql-9.0/bin/psql -f /Users/bacmac/nyc_buildings.sql nyc 

The Geoserver instructions are not explicit about where to put the nyc_buildings.sql file so I have left it in my own user directory 'bacmac'.

Execution of the command produces a string of errors beginning with:

CREATE TABLE
psql:/Users/bacmac/nyc_buildings.sql:4: ERROR:  function addgeometrycolumn(unknown, unknown, unknown, unknown, unknown, integer) does not exist
LINE 1: SELECT AddGeometryColumn('','nyc_buildings','the_geom','2908...
HINT:  No function matches the given name and argument types. You might need to add explicit type casts.
psql:/Users/bacmac/nyc_buildings.sql:5: ERROR:  current transaction is aborted, commands ignored until end of transaction block
psql:/Users/bacmac/nyc_buildings.sql:6: ERROR:  current transaction is aborted ... and so on.


I realise that part of my difficulties stem from a lack of conceptual awareness of how the various parts of PostGIS fit together (databases, data stores, tables, clusters...) and what directory structure the PostGIS installation creates. I am very familiar with Access databases but that may be dangerous because the basic paradigm for PostGIS may be different. Are there any diagrams out there that give a basic conceptual view of Geoserver and PostIGIS? Also, I am coming at this from an enterprise SDI policy and implementation end, not from an IT/Unix background (probably very obvious!). Trying to construct a coherent overall picture based on the predominantly text-based, IT-heavy advice online is proving a challenge.

Many thanks 

Bruce Callander


More information about the postgis-users mailing list