[Tile-serving] [osm2pgsql-dev/osm2pgsql] Add ability to specify `COMMENT ON` PostgreSQL information (Discussion #2331)

Tobias notifications at github.com
Fri May 16 05:32:40 UTC 2025


PostgreSQL has this feature to add text comments to tables and columns. 
- https://www.postgresql.org/docs/current/sql-comment.html

This can be useful to share documentation on the data.
Some tile servers like Martin use this information when they generate their TileJSON.
- https://www.postgresql.org/docs/current/sql-comment.html

It would be nice if I could specify those comments right in my osm2pgsql `define_table` section.
Maybe like…

```lua
local db_table = osm2pgsql.define_table({
  name = 'foo_name',
  description = 'foo data for some purpose',
  ids = { type = 'any', id_column = 'osm_id', type_column = 'osm_type' },
  columns = {
    { column = 'id',   type = 'text', not_null = true },
    { column = 'tags', type = 'jsonb' },
    { column = 'geom', type = 'point' },
    { column = 'minzoom', type = 'integer', description = 'Used by tile rendering functions to filter data based on zoom' },
  }
})
```

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

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


More information about the Tile-serving mailing list