Enable running all tests via "installcheck"
NOTE: also makes CDB_TableMetadata triggers still functional
when user quota and varnish invalidation functions are missing
from the database (currently installed by cartodb ruby)
This commit is contained in:
@@ -35,7 +35,12 @@ BEGIN
|
||||
|
||||
IF dice < pbfact THEN
|
||||
RAISE DEBUG 'Checking quota on table % (dice:%, needed:<%)', TG_RELID::text, dice, pbfact;
|
||||
qmax := public._CDB_UserQuotaInBytes();
|
||||
BEGIN
|
||||
qmax := public._CDB_UserQuotaInBytes();
|
||||
EXCEPTION WHEN undefined_function THEN
|
||||
RAISE WARNING 'Missing _CDB_UserQuotaInBytes(), assuming no quota';
|
||||
RETURN NEW;
|
||||
END;
|
||||
SELECT CDB_UserDataSize() INTO quota;
|
||||
IF quota > qmax THEN
|
||||
RAISE EXCEPTION 'Quota exceeded by %KB', (quota-qmax)/1024;
|
||||
|
||||
@@ -82,7 +82,11 @@ BEGIN
|
||||
--
|
||||
-- LISTEN cdb_tabledata_update;
|
||||
--
|
||||
PERFORM cdb_invalidate_varnish(tabname);
|
||||
BEGIN
|
||||
PERFORM cdb_invalidate_varnish(tabname);
|
||||
EXCEPTION WHEN undefined_function THEN
|
||||
RAISE WARNING 'Missing cdb_invalidate_varnish()';
|
||||
END;
|
||||
|
||||
RETURN NULL;
|
||||
END;
|
||||
|
||||
@@ -22,7 +22,7 @@ AS $$
|
||||
'spatial_ref_sys'
|
||||
)
|
||||
), perms AS (
|
||||
SELECT t, has_table_privilege('publicuser', 'public.'||t, 'SELECT') as p
|
||||
SELECT t, has_table_privilege('publicuser', t, 'SELECT') as p
|
||||
FROM usertables
|
||||
)
|
||||
SELECT t FROM perms
|
||||
|
||||
Reference in New Issue
Block a user