From: Mark Cave-Ayland Date: Mon, 14 Dec 2009 01:38:33 +0000 (+0000) Subject: Fix incorrect logic when outputting escaped strings; COPY does not require the attrib... X-Git-Tag: 1.5.0b1~95 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e1d372a860dec7b3c22dfea4cf01dfbb64edf0cd;p=postgis Fix incorrect logic when outputting escaped strings; COPY does not require the attribute to be surrounded by apostrophes. git-svn-id: http://svn.osgeo.org/postgis/trunk@4998 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/loader/shp2pgsql-core.c b/loader/shp2pgsql-core.c index c030c22f1..8e2e7be64 100644 --- a/loader/shp2pgsql-core.c +++ b/loader/shp2pgsql-core.c @@ -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)