[Tile-serving] [openstreetmap/osm2pgsql] `osm2pgsql-replication`: compute database date fails if data is not in `public` schema (Issue #1818)

Lars Lingner notifications at github.com
Sat Jan 28 20:12:06 UTC 2023


I'm using version 1.7.2 and I'm getting the same error. 

`osm2pgsql  --create  --slim --cache 2000 --output=flex --style=/config/tables.lua --middle-schema=foo  "/data/osm-file.pbf"`

the tables get created in schema `foo` `planet_osm_nodes, planet_osm_rels, planet_osm_ways` and containing data.
the osm data is imported in schema `import` (specified in the lua file).

Running `osm2pgsql-replication init --middle-schema foo --server https://planet.osm.org/replication/minute/` gives me the error:

```
Traceback (most recent call last):
  File "/usr/bin/osm2pgsql-replication", line 556, in <module>
    sys.exit(main())
             ^^^^^^
  File "/usr/bin/osm2pgsql-replication", line 550, in main
    return args.handler(conn, args)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/bin/osm2pgsql-replication", line 293, in init
    date = compute_database_date(conn, args.prefix)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/bin/osm2pgsql-replication", line 106, in compute_database_date
    cur.execute(sql.SQL("SELECT max(id) FROM {}").format(table))
psycopg2.errors.UndefinedTable: relation "planet_osm_ways" does not exist
LINE 1: SELECT max(id) FROM "planet_osm_ways"
```
```
osm2pgsql version 1.7.2
Build: None
Compiled using the following library versions:
Libosmium 2.18.0
Proj [API 6] 9.1.1
Lua 5.3.6
```
`POSTGIS="3.3.2 4975da8" [EXTENSION] PGSQL="150" GEOS="3.9.0-CAPI-1.16.2" PROJ="7.2.1" LIBXML="2.9.10" LIBJSON="0.15" LIBPROTOBUF="1.3.3" WAGYU="0.5.0 (Internal)" TOPOLOGY`

OS: debian sid

Am I making something wrong here? Should I open a new issue about it? 

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/osm2pgsql/issues/1818#issuecomment-1407476857
You are receiving this because you are subscribed to this thread.

Message ID: <openstreetmap/osm2pgsql/issues/1818/1407476857 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/tile-serving/attachments/20230128/3870a5fc/attachment.htm>


More information about the Tile-serving mailing list