Skip to content

Conversation

@joto
Copy link
Collaborator

@joto joto commented May 26, 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.

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.
@mboeringa
Copy link

Looks like a useful addition

@lonvia lonvia merged commit e1631b1 into osm2pgsql-dev:master May 27, 2021
@joto joto deleted the flex-sql-type branch May 29, 2021 13:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants