]> git.openstreetmap.org Git - nominatim.git/blobdiff - tests/steps/terrain.py
cmake: use explicit VPATH when calling pgxs makefile
[nominatim.git] / tests / steps / terrain.py
index 39fc662593c8d9f2fe78d34efc76300d1d418aca..0a4495e01217b8ef3c36cb0275d04dcc9d294849 100644 (file)
@@ -173,7 +173,9 @@ def db_template_setup():
     psycopg2.extras.register_hstore(conn, globally=False, unicode=True)
     cur = conn.cursor()
     for table in ('gb_postcode', 'us_postcode'):
-        cur.execute('TRUNCATE TABLE %s' % (table,))
+        cur.execute("select * from pg_tables where tablename = '%s'" % (table, ))
+        if cur.rowcount > 0:
+            cur.execute('TRUNCATE TABLE %s' % (table,))
     conn.commit()
     conn.close()
     # execute osm2pgsql on an empty file to get the right tables