[Tile-serving] [openstreetmap/osm2pgsql] Add sql_type column field in flex output (#1510)

Jochen Topf notifications at github.com
Wed May 26 10:23:28 UTC 2021


The "type" field in a flex output column definition really does two
things:
1. It defines the way Lua values are transformed into PostgreSQL
   values.
2. It defines which PostgreSQL type should be used in a the CREATE
   TABLE statement for a particular column.

This commit adds a new "sql_type" field which takes over the second
meaning. If it is not specified, the default is still defined by
the "type" field. The default for the type field is "text".

The result is that in most cases you use only the "type" field as before
and it does the right thing. If you need a special SQL type, use the
"sql_type" field instead or in addition to the "type" field.

Note that this is a breaking change, but still allowed because the flex
output is still marked experimental.
You can view, comment on, or merge this pull request online at:

  https://github.com/openstreetmap/osm2pgsql/pull/1510

-- Commit Summary --

  * Add sql_type column field in flex output

-- File Changes --

    M flex-config/attributes.lua (9)
    M flex-config/data-types.lua (8)
    M flex-config/route-relations.lua (2)
    M src/flex-table-column.cpp (25)
    M src/flex-table-column.hpp (17)
    M src/flex-table.cpp (5)
    M src/flex-table.hpp (3)
    M src/lua-utils.cpp (18)
    M src/lua-utils.hpp (4)
    M src/output-flex.cpp (26)
    M tests/data/test_output_flex_types.lua (2)

-- Patch Links --

https://github.com/openstreetmap/osm2pgsql/pull/1510.patch
https://github.com/openstreetmap/osm2pgsql/pull/1510.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/osm2pgsql/pull/1510
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/tile-serving/attachments/20210526/c109af34/attachment.htm>


More information about the Tile-serving mailing list