]> granicus.if.org Git - postgis/commitdiff
Fix incorrect logic when outputting escaped strings; COPY does not require the attrib...
authorMark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>
Mon, 14 Dec 2009 01:38:33 +0000 (01:38 +0000)
committerMark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>
Mon, 14 Dec 2009 01:38:33 +0000 (01:38 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@4998 b70326c6-7e19-0410-871a-916f4a2858ee

loader/shp2pgsql-core.c

index c030c22f1a0b1a86dce0449acfd01852e848f95c..8e2e7be643f42fb81b716b589831ad77a5438372 100644 (file)
@@ -1577,11 +1577,15 @@ ShpLoaderGenerateSQLRowStatement(SHPLOADERSTATE *state, int item, char **strreco
 
                        /* Escape attribute correctly according to dump format */
                        if (state->config->dump_format)
+                       {
                                escval = escape_copy_string(val);
+                               vasbappend(sb, "%s", escval);
+                       }
                        else
+                       {
                                escval = escape_insert_string(val);
-                       
-                       vasbappend(sb, "'%s'", escval);
+                               vasbappend(sb, "'%s'", escval);
+                       }
 
                        /* Free the escaped version if required */
                        if (val != escval)