[Tile-serving] [osm2pgsql-dev/osm2pgsql] define_table() throws an error for name column (Discussion #2267)

Evan notifications at github.com
Sun Oct 27 12:10:21 UTC 2024


I am wondering if I am doing something wrong or if this is a legitimate issue with the code. I am trying to define my own table for insertion into the database. 
I have the following versions of software:
osm2pgsql version 2.0.0
Database version: 16.3
PostGIS version: 3.4

the table definition in question:
```
local pois = osm2pgsql.define_table({
    name = 'pois',
    ids = { type = 'node', id_column = 'id', type_column = 'obj_type' },
    columns = {
        { column = 'name',      type = 'text' },
	    { column = 'tags',      type = 'jsonb' },
	    { column = 'geom',      type = 'point', projection = srid, not_null = true },
    }
})
```

Error Response:

> ERROR: Error loading lua config: [string "..."]:14: Error in 'define_table': The table must contain a 'name' string field


I get the same error for the example definition in the manual.
```
local restaurants = osm2pgsql.define_table({
    name = 'restaurants',
    ids = { type = 'node', id_column = 'node_id' },
    columns = {
        { column = 'name', type = 'text' },
        { column = 'tags', type = 'jsonb' },
        { column = 'geom', type = 'point' }
}})

```

-- 
Reply to this email directly or view it on GitHub:
https://github.com/osm2pgsql-dev/osm2pgsql/discussions/2267
You are receiving this because you are subscribed to this thread.

Message ID: <osm2pgsql-dev/osm2pgsql/repo-discussions/2267 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/tile-serving/attachments/20241027/bb2b9f43/attachment.htm>


More information about the Tile-serving mailing list