[Tile-serving] [openstreetmap/osm2pgsql] add_row outside process_node/way/relation() function (Discussion #1667)
Stefan Sadewasser
notifications at github.com
Thu Apr 21 19:36:37 UTC 2022
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:
```lua
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:
```lua
tables.creationinformation:add_row({
timestampstring = os.date('%Y-%m-%d %X',os.time())
})
```
___
### Problem
I cannot run the `add_row()` function outside of the `process_node/way/relation()` functions<br>
and I want to add the timestamp only once, not several times
### Question
Can anyone help me, or is there another way to realise my idea?
> **NOTE** I know I can do this with simple sql, but I want to do this in flex-output with lua
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/osm2pgsql/discussions/1667
You are receiving this because you are subscribed to this thread.
Message ID: <openstreetmap/osm2pgsql/repo-discussions/1667 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/tile-serving/attachments/20220421/7dc08bee/attachment.htm>
More information about the Tile-serving
mailing list