disable JIT and parallel execution for osm2pgsql updates again

The gazetteer output doesn't disable these functions when
writing to the place table but the triggers may contain
operations that cause misplanning for the query planner.
This commit is contained in:
Sarah Hoffmann
2021-02-16 15:05:14 +01:00
parent 2a8e3741fa
commit c9838a02ce
3 changed files with 13 additions and 0 deletions

View File

@@ -50,6 +50,15 @@ class _Connection(psycopg2.extensions.connection):
WHERE tablename = %s""", (table, ))
return num == 1
def server_version_tuple(self):
""" Return the server version as a tuple of (major, minor).
Converts correctly for pre-10 and post-10 PostgreSQL versions.
"""
version = self.server_version
if version < 100000:
return (version / 10000, (version % 10000) / 100)
return (version / 10000, version % 10000)
def connect(dsn):
""" Open a connection to the database using the specialised connection