CDB-3094 Discovered that EXECUTE FORMAT seems to quote schema names when it needs to
This commit is contained in:
@@ -47,7 +47,7 @@ BEGIN
|
|||||||
-- TODO: Check that user quota is set ?
|
-- TODO: Check that user quota is set ?
|
||||||
BEGIN
|
BEGIN
|
||||||
-- Content will be discarded
|
-- 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
|
EXCEPTION WHEN undefined_function THEN
|
||||||
RAISE EXCEPTION 'Please set user quota before cartodbfying tables.';
|
RAISE EXCEPTION 'Please set user quota before cartodbfying tables.';
|
||||||
END;
|
END;
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ BEGIN
|
|||||||
qmax := TG_ARGV[1];
|
qmax := TG_ARGV[1];
|
||||||
ELSE
|
ELSE
|
||||||
BEGIN
|
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
|
EXCEPTION WHEN undefined_function THEN
|
||||||
RAISE EXCEPTION 'Missing "%"._CDB_UserQuotaInBytes()', schema_name;
|
RAISE EXCEPTION 'Missing "%"._CDB_UserQuotaInBytes()', schema_name;
|
||||||
END;
|
END;
|
||||||
@@ -93,7 +93,7 @@ BEGIN
|
|||||||
END IF;
|
END IF;
|
||||||
|
|
||||||
BEGIN
|
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
|
EXCEPTION WHEN undefined_function THEN
|
||||||
current_quota := 0;
|
current_quota := 0;
|
||||||
END;
|
END;
|
||||||
|
|||||||
Reference in New Issue
Block a user