|
|
@ -36,7 +36,7 @@ BEGIN
|
|
|
|
IF dice < pbfact THEN
|
|
|
|
IF dice < pbfact THEN
|
|
|
|
RAISE DEBUG 'Checking quota on table % (dice:%, needed:<%)', TG_RELID::text, dice, pbfact;
|
|
|
|
RAISE DEBUG 'Checking quota on table % (dice:%, needed:<%)', TG_RELID::text, dice, pbfact;
|
|
|
|
BEGIN
|
|
|
|
BEGIN
|
|
|
|
qmax := cartodb._CDB_UserQuotaInBytes();
|
|
|
|
qmax := public._CDB_UserQuotaInBytes();
|
|
|
|
EXCEPTION WHEN undefined_function THEN
|
|
|
|
EXCEPTION WHEN undefined_function THEN
|
|
|
|
RAISE WARNING 'Missing _CDB_UserQuotaInBytes(), assuming no quota';
|
|
|
|
RAISE WARNING 'Missing _CDB_UserQuotaInBytes(), assuming no quota';
|
|
|
|
qmax := 0;
|
|
|
|
qmax := 0;
|
|
|
@ -67,12 +67,12 @@ DECLARE
|
|
|
|
sql text;
|
|
|
|
sql text;
|
|
|
|
BEGIN
|
|
|
|
BEGIN
|
|
|
|
BEGIN
|
|
|
|
BEGIN
|
|
|
|
current_quota := cartodb._CDB_UserQuotaInBytes();
|
|
|
|
current_quota := public._CDB_UserQuotaInBytes();
|
|
|
|
EXCEPTION WHEN undefined_function THEN
|
|
|
|
EXCEPTION WHEN undefined_function THEN
|
|
|
|
current_quota := 0;
|
|
|
|
current_quota := 0;
|
|
|
|
END;
|
|
|
|
END;
|
|
|
|
|
|
|
|
|
|
|
|
sql := 'CREATE OR REPLACE FUNCTION cartodb._CDB_UserQuotaInBytes() '
|
|
|
|
sql := 'CREATE OR REPLACE FUNCTION public._CDB_UserQuotaInBytes() '
|
|
|
|
|| 'RETURNS int8 AS $X$ SELECT ' || bytes
|
|
|
|
|| 'RETURNS int8 AS $X$ SELECT ' || bytes
|
|
|
|
|| '::int8 $X$ LANGUAGE sql IMMUTABLE';
|
|
|
|
|| '::int8 $X$ LANGUAGE sql IMMUTABLE';
|
|
|
|
EXECUTE sql;
|
|
|
|
EXECUTE sql;
|
|
|
|