From c9f4685e5d0498c96a0796c5e851ef0f83690768 Mon Sep 17 00:00:00 2001 From: Mario de Frutos Date: Wed, 21 Mar 2018 12:55:38 +0100 Subject: [PATCH] Fix error with hyphens, moving logic to the Format part --- scripts-available/CDB_CartodbfyTable.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts-available/CDB_CartodbfyTable.sql b/scripts-available/CDB_CartodbfyTable.sql index 7ec3de1..175cf2a 100644 --- a/scripts-available/CDB_CartodbfyTable.sql +++ b/scripts-available/CDB_CartodbfyTable.sql @@ -911,7 +911,7 @@ BEGIN INTO relseq; -- If it's the name we want, then rename it IF relseq IS NOT NULL AND relseq = Format('%I.%I', destschema, destseq) THEN - PERFORM _CDB_SQL(Format('ALTER SEQUENCE %s RENAME TO tmp_%s', relseq, destseq), '_CDB_Rewrite_Table'); + PERFORM _CDB_SQL(Format('ALTER SEQUENCE %s RENAME TO %I', relseq, Format('tmp_%s', destseq)), '_CDB_Rewrite_Table'); END IF; END IF;