<p dir="auto">If a condition is set with "if_has_rows", the SQL command in "if_has_rows" will be run and only if that returns any rows, the main sql command is run. This check happens only in "append" mode, in "create" mode the command is always run.</p>
<p dir="auto">To be used with something like "SELECT 1 FROM some_table LIMIT 1" to check whether the table has any rows (for instance an expire table).</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/2064'>https://github.com/openstreetmap/osm2pgsql/pull/2064</a></p>
<h4>Commit Summary</h4>
<ul>
<li><a href="https://github.com/openstreetmap/osm2pgsql/pull/2064/commits/30af427c6a50e9bb0ca0d9f55d498a6ea563f418" class="commit-link">30af427</a> Generalization: Allow setting condition for running SQL commands</li>
</ul>
<h4 style="display: inline-block">File Changes </h4> <p style="display: inline-block">(<a href="https://github.com/openstreetmap/osm2pgsql/pull/2064/files">1 file</a>)</p>
<ul>
<li>
<strong>M</strong>
<a href="https://github.com/openstreetmap/osm2pgsql/pull/2064/files#diff-af990b4913ef709327b65c38b7aa4719b2caaed25de91ebd7496daf528ac8386">src/gen/osm2pgsql-gen.cpp</a>
(16)
</li>
</ul>
<h4>Patch Links:</h4>
<ul>
<li><a href='https://github.com/openstreetmap/osm2pgsql/pull/2064.patch'>https://github.com/openstreetmap/osm2pgsql/pull/2064.patch</a></li>
<li><a href='https://github.com/openstreetmap/osm2pgsql/pull/2064.diff'>https://github.com/openstreetmap/osm2pgsql/pull/2064.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/2064">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AA6353XN65KLPVCDVHOS4PTXYSEQ5ANCNFSM6AAAAAA4JKY4YE">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AA6353QX67H3TZKHDMF2PL3XYSEQ5A5CNFSM6AAAAAA4JKY4YGWGG33NNVSW45C7OR4XAZNFJFZXG5LFVJRW63LNMVXHIX3JMTHHAAHPSA.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/2064</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/2064",
"url": "https://github.com/openstreetmap/osm2pgsql/pull/2064",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>