From 7bdee5c13e4ac2a13c0ef8b418ff287fff3996b5 Mon Sep 17 00:00:00 2001 From: Javier Goizueta Date: Wed, 3 Jul 2019 18:34:54 +0200 Subject: [PATCH] Avoid double-quoting Since dst_schema is a REGNAMESPACE, it is automatically quoted when casted to TEXT --- scripts-available/CDB_SyncTable.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts-available/CDB_SyncTable.sql b/scripts-available/CDB_SyncTable.sql index 322ec37..122db9a 100644 --- a/scripts-available/CDB_SyncTable.sql +++ b/scripts-available/CDB_SyncTable.sql @@ -127,7 +127,7 @@ DECLARE t timestamptz; BEGIN -- If the destination table does not exist, just copy the source table - fq_dest_table := format('%I.%I', dst_schema, dst_table); + fq_dest_table := format('%s.%I', dst_schema, dst_table); EXECUTE format('CREATE TABLE IF NOT EXISTS %s as TABLE %I', fq_dest_table, src_table); GET DIAGNOSTICS num_rows = ROW_COUNT; IF num_rows > 0 THEN