please advice what could be wrong in my situation:

  • I succesfully generated sql-file using osm2po
  • I tried to run it within PostgreSQL and got the following error:

    ********** Error **********
    ERROR: Table 'BY2_2po_4pgr' does not occur in the search_path
    SQL state: P0001
    Context: SQL statement "SELECT AddGeometryColumn('','',$1,$2,$3,$4,$5, $6)"
    PL/pgSQL function "addgeometrycolumn" line 5 at SQL statement

Working on Win7(x64) with PostgreSQL 9.1 and PostGIS 2.0.1 osm2po ver 4.5.25

Any ideas appreciated!

  • it looks like addgeometrycolumn fails but why? (db looks like postGIS enabled - I see spatial_ref_sys table) – Andrew Mar 6 '13 at 14:47

Just an assumption: Maybe this is a lower/upper case problem. Try it with "by2" instead of "BY2"

  • yes, this is correct assumption - see my answer below – Andrew Mar 7 '13 at 7:59

The problem solved. Actual issue was in upper case characters in the table name, i.e. call

SELECT AddGeometryColumn('BY2_2po_4pgr', 'geom_way', 4326, 'LINESTRING', 2);

returns mentioned above error, while call

SELECT AddGeometryColumn('by2_2po_4pgr', 'geom_way', 4326, 'LINESTRING', 2);

executes without any problems.
Thus it is not recommended to use upper case letters for prefix name in osm2po!!

  • This is half true because it only relates to the generation of sql files for PostGIS. The intrinsic reason for this bad behavior is that a CREATE TABLE in PostgreSQL allows upper case letters, but auto converts them into lower case and PostGIS then fails with its AddGeometryColumn. Nevertheless, this is sth. I should make safe in the next version. – Carsten Mar 7 '13 at 9:13
  • agree. in ideal case PostGIS should have consistent with Postgres behavior in working with table names – Andrew Mar 7 '13 at 11:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.