From 46496661bbe6c6a31e122623557b806d705efc4d Mon Sep 17 00:00:00 2001 From: Robert Marianski Date: Mon, 18 Aug 2014 13:11:20 -0400 Subject: [PATCH] constrain geometry check to way column When more than one geometry column exists in a table, the sanity check was failing when running osm2pgsql in append mode. This constrains the number of rows and srid check to the way column specifically. --- output-pgsql.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/output-pgsql.c b/output-pgsql.c index 88887cf91..827ae5433 100644 --- a/output-pgsql.c +++ b/output-pgsql.c @@ -858,7 +858,7 @@ static int pgsql_out_start(const struct output_options *options) } else { - sprintf(sql, "SELECT srid FROM geometry_columns WHERE f_table_name='%s';", tables[i].name); + sprintf(sql, "SELECT srid FROM geometry_columns WHERE f_table_name='%s' AND f_geometry_column='way';", tables[i].name); res = PQexec(sql_conn, sql); if (!((PQntuples(res) == 1) && (PQnfields(res) == 1))) {