[GRASS-SVN] r74042 - grass/trunk/db/drivers/postgres

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Jan 30 00:41:15 PST 2019


Author: mmetz
Date: 2019-01-30 00:41:15 -0800 (Wed, 30 Jan 2019)
New Revision: 74042

Modified:
   grass/trunk/db/drivers/postgres/index.c
Log:
postgres driver: create index if not exists for PG server versions 9.5+

Modified: grass/trunk/db/drivers/postgres/index.c
===================================================================
--- grass/trunk/db/drivers/postgres/index.c	2019-01-29 17:15:05 UTC (rev 74041)
+++ grass/trunk/db/drivers/postgres/index.c	2019-01-30 08:41:15 UTC (rev 74042)
@@ -34,6 +34,8 @@
 	db_append_string(&sql, " unique");
 
     db_append_string(&sql, " index ");
+    if (PQserverVersion(pg_conn) >= 905000)
+	db_append_string(&sql, " if not exists ");
     db_append_string(&sql, db_get_index_name(index));
     db_append_string(&sql, " on ");
 



More information about the grass-commit mailing list