CDB-3094 Discovered that EXECUTE FORMAT seems to quote schema names when it needs to

This commit is contained in:
Kartones 2014-07-04 16:39:19 +02:00
parent 3c5251e6c6
commit 1c86599f9d
2 changed files with 3 additions and 3 deletions

View File

@ -47,7 +47,7 @@ BEGIN
-- TODO: Check that user quota is set ?
BEGIN
-- Content will be discarded
EXECUTE FORMAT('SELECT "%I"._CDB_UserQuotaInBytes();', schema_name::text) INTO sql;
EXECUTE FORMAT('SELECT %I._CDB_UserQuotaInBytes();', schema_name::text) INTO sql;
EXCEPTION WHEN undefined_function THEN
RAISE EXCEPTION 'Please set user quota before cartodbfying tables.';
END;

View File

@ -51,7 +51,7 @@ BEGIN
qmax := TG_ARGV[1];
ELSE
BEGIN
EXECUTE FORMAT('SELECT "%I"._CDB_UserQuotaInBytes();', schema_name) INTO qmax;
EXECUTE FORMAT('SELECT %I._CDB_UserQuotaInBytes();', schema_name) INTO qmax;
EXCEPTION WHEN undefined_function THEN
RAISE EXCEPTION 'Missing "%"._CDB_UserQuotaInBytes()', schema_name;
END;
@ -93,7 +93,7 @@ BEGIN
END IF;
BEGIN
EXECUTE FORMAT('SELECT "%I"._CDB_UserQuotaInBytes();', schema_name::text) INTO current_quota;
EXECUTE FORMAT('SELECT %I._CDB_UserQuotaInBytes();', schema_name::text) INTO current_quota;
EXCEPTION WHEN undefined_function THEN
current_quota := 0;
END;