<p>Not necessarily, but osm2pgsql does <em>sometimes</em> change in ways that are incompatible with old setups. Hence why I was asking whether you had updated (and ideally, from what version to what version).</p>
<p>It is likely cleanest to do a full reload. (If your data is older than a month or so, you won't be able to efficiently update it anyway.) However, you can change the projection of your existing database by executing these steps:</p>
<pre><code> ALTER TABLE planet_osm_polygon ALTER COLUMN way TYPE geometry(Geometry);
 ALTER TABLE planet_osm_roads ALTER COLUMN way TYPE geometry(LineString);
 ALTER TABLE planet_osm_line ALTER COLUMN way TYPE geometry(LineString);
 ALTER TABLE planet_osm_roads ALTER COLUMN way TYPE geometry(Point);

 UPDATE planet_osm_polygon SET way = ST_SETSRID(way, 3857);
 UPDATE planet_osm_roads SET way = ST_SETSRID(way, 3857);
 UPDATE planet_osm_line SET way = ST_SETSRID(way, 3857);
 UPDATE planet_osm_point SET way = ST_SETSRID(way, 3857);

 ALTER TABLE planet_osm_polygon ALTER COLUMN way TYPE geometry(Geometry, 3857);
 ALTER TABLE planet_osm_roads ALTER COLUMN way TYPE geometry(LineString, 3857);
 ALTER TABLE planet_osm_line ALTER COLUMN way TYPE geometry(LineString, 3857);
 ALTER TABLE planet_osm_roads ALTER COLUMN way TYPE geometry(Point, 3857);
</code></pre>
<p>The first block removes the 900913 type specification from the column, the second updates the geometries, the third adds a specification for 3857. Projections 900913 and 3857 are identical, they just have different names.</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/869#issuecomment-423927009">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AD2-7kVC3EcS7W9gOYVCIbw-7O5iipVBks5ueK2ygaJpZM4W2D7F">mute the thread</a>.<img src="https://github.com/notifications/beacon/AD2-7hyIrIi-4KEC5U04NPhbKlwIWEIfks5ueK2ygaJpZM4W2D7F.gif" height="1" width="1" alt="" /></p>
<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/openstreetmap/osm2pgsql","title":"openstreetmap/osm2pgsql","subtitle":"GitHub repository","main_image_url":"https://assets-cdn.github.com/images/email/message_cards/header.png","avatar_image_url":"https://assets-cdn.github.com/images/email/message_cards/avatar.png","action":{"name":"Open in GitHub","url":"https://github.com/openstreetmap/osm2pgsql"}},"updates":{"snippets":[{"icon":"PERSON","message":"@woodpeck in #869: Not necessarily, but osm2pgsql does *sometimes* change in ways that are incompatible with old setups. Hence why I was asking whether you had updated (and ideally, from what version to what version). \r\n\r\nIt is likely cleanest to do a full reload. (If your data is older than a month or so, you won't be able to efficiently update it anyway.) However, you can change the projection of your existing database by executing these steps:\r\n\r\n     ALTER TABLE planet_osm_polygon ALTER COLUMN way TYPE geometry(Geometry);\r\n     ALTER TABLE planet_osm_roads ALTER COLUMN way TYPE geometry(LineString);\r\n     ALTER TABLE planet_osm_line ALTER COLUMN way TYPE geometry(LineString);\r\n     ALTER TABLE planet_osm_roads ALTER COLUMN way TYPE geometry(Point);\r\n\r\n     UPDATE planet_osm_polygon SET way = ST_SETSRID(way, 3857);\r\n     UPDATE planet_osm_roads SET way = ST_SETSRID(way, 3857);\r\n     UPDATE planet_osm_line SET way = ST_SETSRID(way, 3857);\r\n     UPDATE planet_osm_point SET way = ST_SETSRID(way, 3857);\r\n\r\n     ALTER TABLE planet_osm_polygon ALTER COLUMN way TYPE geometry(Geometry, 3857);\r\n     ALTER TABLE planet_osm_roads ALTER COLUMN way TYPE geometry(LineString, 3857);\r\n     ALTER TABLE planet_osm_line ALTER COLUMN way TYPE geometry(LineString, 3857);\r\n     ALTER TABLE planet_osm_roads ALTER COLUMN way TYPE geometry(Point, 3857);\r\n\r\nThe first block removes the 900913 type specification from the column, the second updates the geometries, the third adds a specification for 3857. Projections 900913 and 3857 are identical, they just have different names."}],"action":{"name":"View Issue","url":"https://github.com/openstreetmap/osm2pgsql/issues/869#issuecomment-423927009"}}}</script>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/openstreetmap/osm2pgsql/issues/869#issuecomment-423927009",
"url": "https://github.com/openstreetmap/osm2pgsql/issues/869#issuecomment-423927009",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
},
{
"@type": "MessageCard",
"@context": "http://schema.org/extensions",
"hideOriginalBody": "false",
"originator": "AF6C5A86-E920-430C-9C59-A73278B5EFEB",
"title": "Re: [openstreetmap/osm2pgsql]  ERROR: Geometry SRID (3857) does not match column SRID (900913) (#869)",
"sections": [
{
"text": "",
"activityTitle": "**Frederik Ramm**",
"activityImage": "https://assets-cdn.github.com/images/email/message_cards/avatar.png",
"activitySubtitle": "@woodpeck",
"facts": [

]
}
],
"potentialAction": [
{
"name": "Add a comment",
"@type": "ActionCard",
"inputs": [
{
"isMultiLine": true,
"@type": "TextInput",
"id": "IssueComment",
"isRequired": false
}
],
"actions": [
{
"name": "Comment",
"@type": "HttpPOST",
"target": "https://api.github.com",
"body": "{\n\"commandName\": \"IssueComment\",\n\"repositoryFullName\": \"openstreetmap/osm2pgsql\",\n\"issueId\": 869,\n\"IssueComment\": \"{{IssueComment.value}}\"\n}"
}
]
},
{
"name": "Close issue",
"@type": "HttpPOST",
"target": "https://api.github.com",
"body": "{\n\"commandName\": \"IssueClose\",\n\"repositoryFullName\": \"openstreetmap/osm2pgsql\",\n\"issueId\": 869\n}"
},
{
"targets": [
{
"os": "default",
"uri": "https://github.com/openstreetmap/osm2pgsql/issues/869#issuecomment-423927009"
}
],
"@type": "OpenUri",
"name": "View on GitHub"
},
{
"name": "Unsubscribe",
"@type": "HttpPOST",
"target": "https://api.github.com",
"body": "{\n\"commandName\": \"MuteNotification\",\n\"threadId\": 383270597\n}"
}
],
"themeColor": "26292E"
}
]</script>