<p>This was reported via the dev mailinglist:</p>
<blockquote>
<p>I've found out my OSM Tile Server has stopped updating and osm2pgsql (v1.2)<br>
gives off the following error:</p>
<p>DB writer thread failed due to ERROR: result COPY_END for planet_osm_line<br>
failed: ERROR:  invalid input syntax for integer: "-"<br>
CONTEXT:  COPY planet_osm_line, line 1437, column layer: "-"</p>
<p>Looking through its changefile, the following entry can be found:</p>
<pre><code>    <way id="742619958" version="1" timestamp="2019-11-06T15:32:03Z"                              
uid="978786" user="padvinder" changeset="76711047">                                               
      <nd ref="6952022619"/>                                                                      
      <nd ref="6952022612"/>                                                                      
      <tag k="layer" v="-"/>                                                                      
      <tag k="tunnel" v="culvert"/>                                                               
      <tag k="waterway" v="drain"/>                                                               
    </way>
</code></pre>
<p>This seems to be malformed, as the layer should've never been "-", as this is<br>
not a valid integer.<br>
You can see this for yourself at:<br>
<a href="https://planet.openstreetmap.org/replication/minute/003/747/729.osc.gz" rel="nofollow">https://planet.openstreetmap.org/replication/minute/003/747/729.osc.gz</a><br>
Also more information on the layer key is over here:<br>
<a href="https://wiki.openstreetmap.org/wiki/Key:layer" rel="nofollow">https://wiki.openstreetmap.org/wiki/Key:layer</a></p>
</blockquote>
<p>Needs confirmation via an additional test in <code>tests/test-output-pgsql-int4.cpp</code> and potential fixing.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/openstreetmap/osm2pgsql/issues/988?email_source=notifications&email_token=AA6353QIN4ITQ3RWXQMNQ2TQUT6KHA5CNFSM4JPPUS4KYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4H2VE6BA">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AA6353SKP3DQ423IQJAX7X3QUT6KHANCNFSM4JPPUS4A">unsubscribe</a>.<img src="https://github.com/notifications/beacon/AA6353S2CKZ2NK3BCZDX3K3QUT6KHA5CNFSM4JPPUS4KYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4H2VE6BA.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/openstreetmap/osm2pgsql/issues/988?email_source=notifications\u0026email_token=AA6353QIN4ITQ3RWXQMNQ2TQUT6KHA5CNFSM4JPPUS4KYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4H2VE6BA",
"url": "https://github.com/openstreetmap/osm2pgsql/issues/988?email_source=notifications\u0026email_token=AA6353QIN4ITQ3RWXQMNQ2TQUT6KHA5CNFSM4JPPUS4KYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4H2VE6BA",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>