-
In order to be able to react to changes in the database, I would like to store the time of use of osm2pgsql in a table. I imagined it like this: i would add a new table definition in the lua script, like: tables.creationinformation = osm2pgsql.define_table({
name = 'creationinformation',
columns = {
{ column = 'id', sql_type = 'bigserial', create_only = true },
{ column = 'timestamp', type = 'text' }
}
}) At the beginning of the conversion process, an entry is to be created in the creationinformation table, such as: tables.creationinformation:add_row({
timestampstring = os.date('%Y-%m-%d %X',os.time())
}) ProblemI cannot run the QuestionCan anyone help me, or is there another way to realise my idea?
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
You could do the If you insist in doing this from Lua, you can use the Lua Postgresql package do access the database from there. That would be a cleaner solution at least. |
Beta Was this translation helpful? Give feedback.
You could do the
add_row()
in one of the process functions and set a global Lua variable when you have done so. But you shouldn't do tricks like that. For one I am not sure whether defining a table without id columns will work and, if it doesn't, you end up with a table with some kind of OSM id column and every time osm2pgsql sees a change it will try to delete the feature from that table, which adds more overhead.If you insist in doing this from Lua, you can use the Lua Postgresql package do access the database from there. That would be a cleaner solution at least.