Let CDB_CheckQuota second parameter override configured user quota

Closes #13
Includes automated test
This commit is contained in:
Sandro Santilli
2014-05-09 12:55:41 +02:00
parent 1643ae2db1
commit b69ded8f66
3 changed files with 20 additions and 6 deletions

View File

@@ -1,6 +1,12 @@
set client_min_messages to ERROR;
\set VERBOSITY terse
CREATE TABLE big(a int);
-- Try the legacy interface
-- See https://github.com/CartoDB/cartodb-postgresql/issues/13
CREATE TRIGGER test_quota BEFORE UPDATE OR INSERT ON big
EXECUTE PROCEDURE CDB_CheckQuota(1,1);
INSERT INTO big VALUES (1); -- allowed, check runs before
INSERT INTO big VALUES (1); -- disallowed, quota exceeds before
SELECT CDB_CartodbfyTable('big');
INSERT INTO big SELECT generate_series(1,1024);
SELECT CDB_SetUserQuotaInBytes(8);