]> granicus.if.org Git - postgis/commitdiff
#2473, only create spatial index if there's a shape file
authorPaul Ramsey <pramsey@cleverelephant.ca>
Tue, 29 Sep 2015 12:54:22 +0000 (12:54 +0000)
committerPaul Ramsey <pramsey@cleverelephant.ca>
Tue, 29 Sep 2015 12:54:22 +0000 (12:54 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@14132 b70326c6-7e19-0410-871a-916f4a2858ee

loader/shp2pgsql-core.c

index 460baffb7ae11a7929d15c9a09b223855be573a7..43a1af9da12167c8b0a891248d7f74d772321290 100644 (file)
@@ -1819,7 +1819,7 @@ ShpLoaderGetSQLFooter(SHPLOADERSTATE *state, char **strfooter)
        stringbuffer_clear(sb);
 
        /* Create gist index if specified and not in "prepare" mode */
-       if (state->config->createindex)
+       if (state->config->readshape && state->config->createindex)
        {
                stringbuffer_aprintf(sb, "CREATE INDEX ON ");
                /* Schema is optional, include if present. */