<p></p>
<p dir="auto">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.</p>
<p dir="auto">I imagined it like this:</p>
<p dir="auto">i would add a new table definition in the lua script, like:</p>
<div class="highlight highlight-source-lua"><pre>tables.<span class="pl-smi">creationinformation</span> <span class="pl-k">=</span> osm2pgsql.<span class="pl-c1">define_table</span>({
    name <span class="pl-k">=</span> <span class="pl-s"><span class="pl-pds">'</span>creationinformation<span class="pl-pds">'</span></span>,
    columns <span class="pl-k">=</span> {
        { column <span class="pl-k">=</span> <span class="pl-s"><span class="pl-pds">'</span>id<span class="pl-pds">'</span></span>, sql_type <span class="pl-k">=</span> <span class="pl-s"><span class="pl-pds">'</span>bigserial<span class="pl-pds">'</span></span>, create_only <span class="pl-k">=</span> <span class="pl-c1">true</span> },
        { column <span class="pl-k">=</span> <span class="pl-s"><span class="pl-pds">'</span>timestamp<span class="pl-pds">'</span></span>, type <span class="pl-k">=</span> <span class="pl-s"><span class="pl-pds">'</span>text<span class="pl-pds">'</span></span> }
    }
})</pre></div>
<p dir="auto">At the beginning of the conversion process, an entry is to be created in the creationinformation table, such as:</p>
<div class="highlight highlight-source-lua"><pre>tables.<span class="pl-smi">creationinformation</span>:<span class="pl-c1">add_row</span>({
timestampstring <span class="pl-k">=</span> <span class="pl-c1">os.date</span>(<span class="pl-s"><span class="pl-pds">'</span>%Y-%m-%d %X<span class="pl-pds">'</span></span>,<span class="pl-c1">os.time</span>())
}) </pre></div>
<hr>
<h3 dir="auto">Problem</h3>
<p dir="auto">I cannot run the <code>add_row()</code> function outside of the <code>process_node/way/relation()</code> functions<br><br>
and I want to add the timestamp only once, not several times</p>
<h3 dir="auto">Question</h3>
<p dir="auto">Can anyone help me, or is there another way to realise my idea?</p>
<blockquote>
<p dir="auto"><strong>NOTE</strong> I know I can do this with simple sql, but I want to do this in flex-output with lua</p>
</blockquote>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />Reply to this email directly, <a href="https://github.com/openstreetmap/osm2pgsql/discussions/1667">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AA6353VFCOUAWYHPNPFSLQDVGGU4LANCNFSM5UAHB2FA">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AA6353QK4TAILQNV4UCXH7LVGGU4LA5CNFSM5UAHB2FKYY3PNVWWK3TUL52HS4DFVJCGS43DOVZXG2LPN2VGG33NNVSW45C7NFSM4AB5NYIA.gif" height="1" width="1" alt="" /><span style="color: transparent; font-size: 0; display: none; visibility: hidden; overflow: hidden; opacity: 0; width: 0; height: 0; max-width: 0; max-height: 0; mso-hide: all">Message ID: <span><openstreetmap/osm2pgsql/repo-discussions/1667</span><span>@</span><span>github</span><span>.</span><span>com></span></span></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/openstreetmap/osm2pgsql/discussions/1667",
"url": "https://github.com/openstreetmap/osm2pgsql/discussions/1667",
"name": "View Discussion"
},
"description": "View this Discussion on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>