Add an sql wrapper around passed value in an add_row function #1524
Replies: 2 comments 1 reply
-
As you just found out (see #1522) exposing database features to the osm2pgsql user is difficult to handle and error prone. There are just too many thing that can go wrong and they restrict what kind of changes we can later do in osm2pgsql. We therefore try to avoid this as much as possible. In this case we can't even do what you want (if I understand you correctly), because of the way the COPY command works. Unlike with the INSERT command, you can only send data through a COPY, not call functions and the like. Any kind of processing you want to do in the database is probably best done with database methods such as triggers and views. PostgreSQL supports many clever tricks and workarounds and they are, admittedly often difficult to use, but its only a small minority who needs these things. It would probably be interesting to start collecting these tricks and documenting them, though. |
Beta Was this translation helpful? Give feedback.
-
The Is it possible to let |
Beta Was this translation helpful? Give feedback.
-
Last addition to a flex backend adds an sql_type, which is quite handy.
Another great feature could be addition of sql wrapper around passed column value in add_row function.
I guess all column values are being passed to a generated sql COPY command.
This process is unreachable for lua script. Can it be exposed?
For example something like this
Concatenation is used just to give an idea, real implementation could of course be cleaner.
Beta Was this translation helpful? Give feedback.
All reactions