Search code examples
postgresqlopenstreetmap

Postgres NATURAL as attribute is represented as "natural"


I'm working with openstreetmap data and import it with tools into a postgres database. One key term in openstreetmap is natural.

When importing this data, a column name in the postgres database table is natural. The issue is, when reading the table in some clients, the attribute natural is represented as "natural" which leads to issues.

Is there a way to store "natural" as natural OR help the client to read it properly?


Solution

  • natural is a reserved keyword in postgres:

    https://www.postgresql.org/docs/current/sql-keywords-appendix.html

    keywords have to be quoted if they are used as identifiers. If possible, choose a different name.