Do not call CDB_Invalidate_Varnish() if not owned by a superuser

Search for that function in schemas cartodb and public (in that order).
Closes #24
This commit is contained in:
Sandro Santilli
2014-05-14 19:02:46 +02:00
parent ca4ce102bb
commit 2f0031e6a2
3 changed files with 23 additions and 28 deletions

View File

@@ -1,17 +1,5 @@
\set VERBOSITY terse
-- Create a stub cdb_invalidate_varnish function if not available
--CREATE FUNCTION tmp() returns void AS $$
DO $$
BEGIN
PERFORM cdb_invalidate_varnish(0);
EXCEPTION
WHEN undefined_function THEN
CREATE OR REPLACE FUNCTION cartodb.cdb_invalidate_varnish(tabname text)
RETURNS void AS '' LANGUAGE 'sql';
END;
$$ LANGUAGE 'plpgsql';
-- Set user quota to infinite
SELECT CDB_SetUserQuotaInBytes(0);