diff --git a/xyz-util/src/main/resources/sql/s3_export.sql b/xyz-util/src/main/resources/sql/s3_export.sql index f4aca771f4..e5ba579131 100644 --- a/xyz-util/src/main/resources/sql/s3_export.sql +++ b/xyz-util/src/main/resources/sql/s3_export.sql @@ -40,7 +40,7 @@ BEGIN ||' NULL,' ||' %5$L )', - format('select jsondata || jsonb_build_object(''''geometry'''', ST_AsGeoJSON(geo, 8)::jsonb) from (%1$s) X', content_query), + format('select jsondata || jsonb_build_object(''''geometry'''', ST_AsGeoJSON(geo, 8)::jsonb) from (%1$s) X', REPLACE(content_query, $x$'$x$, $x$''$x$)), s3_bucket, s3_path, s3_region, diff --git a/xyz-util/src/main/resources/sql/transport.sql b/xyz-util/src/main/resources/sql/transport.sql index b3f7e41b3a..daed7e8e7e 100644 --- a/xyz-util/src/main/resources/sql/transport.sql +++ b/xyz-util/src/main/resources/sql/transport.sql @@ -278,7 +278,7 @@ BEGIN ctx JSONB := '$wrappedouter$||(ctx::TEXT)||$wrappedouter$'::JSONB; work_item JSONB := '$wrappedouter$||(work_item::TEXT)||$wrappedouter$'::JSONB; format TEXT := '$wrappedouter$||format||$wrappedouter$'::TEXT; - content_query TEXT := '$wrappedouter$||(coalesce(content_query,''))||$wrappedouter$'::TEXT; + content_query TEXT := $x$$wrappedouter$||coalesce(content_query,'')||$wrappedouter$$x$::TEXT; retry_count INT := 2; BEGIN BEGIN