<p dir="auto">This adds two timestamp (with timezone) columns to all expire tables called "first" and "last". When an entry is added, both are set to the current (transaction) timestamp. When an entry already exists a new insert will result in the "last" timestamp being updated.</p>
<p dir="auto">Having these two timestamps allows various expire/updating strategies, for instance:</p>
<ul dir="auto">
<li>update oldest entry</li>
<li>update entry that didn't change for the longest time</li>
<li>update older entries but only if there are no recent changes, which indicates that there might be more changes coming</li>
</ul>
<p dir="auto">For backwards compatibility the code detects which table format is used and falls back to the old behaviour if the timestamp columns aren't there.</p>
<p dir="auto">We are currently not using the timestamps anywhere in osm2pgsql but they can already be used outside osm2pgsql and the generalization code will be able to use these in the future.</p>

<hr>

<h4>You can view, comment on, or merge this pull request online at:</h4>
<p>  <a href='https://github.com/openstreetmap/osm2pgsql/pull/2080'>https://github.com/openstreetmap/osm2pgsql/pull/2080</a></p>

<h4>Commit Summary</h4>
<ul>
  <li><a href="https://github.com/openstreetmap/osm2pgsql/pull/2080/commits/fb0d5d57858b4560ee8fb53a9216a867de5107de" class="commit-link">fb0d5d5</a>  Add first/last timestamps to expire tables</li>
</ul>

<h4 style="display: inline-block">File Changes </h4> <p style="display: inline-block">(<a href="https://github.com/openstreetmap/osm2pgsql/pull/2080/files">1 file</a>)</p>
<ul>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/osm2pgsql/pull/2080/files#diff-abc346816b069a6261b82d50b870e16e220672270b50ee95cf6994a438b8c67f">src/expire-output.cpp</a>
    (35)
  </li>
</ul>

<h4>Patch Links:</h4>
<ul>
  <li><a href='https://github.com/openstreetmap/osm2pgsql/pull/2080.patch'>https://github.com/openstreetmap/osm2pgsql/pull/2080.patch</a></li>
  <li><a href='https://github.com/openstreetmap/osm2pgsql/pull/2080.diff'>https://github.com/openstreetmap/osm2pgsql/pull/2080.diff</a></li>
</ul>

<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/pull/2080">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AA6353RNUKHRZCWICKAZDE3X3AGUFANCNFSM6AAAAAA44M32CY">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AA6353QCWP2NI45OODPTIGLX3AGUFA5CNFSM6AAAAAA44M32C2WGG33NNVSW45C7OR4XAZNFJFZXG5LFVJRW63LNMVXHIX3JMTHHCR33WM.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/pull/2080</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/pull/2080",
"url": "https://github.com/openstreetmap/osm2pgsql/pull/2080",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>