Add CDB_SetUserQuotaInBytes function

Closes #2
This commit is contained in:
Sandro Santilli
2014-05-08 17:14:06 +02:00
parent 055efe04aa
commit acf3097c3a
3 changed files with 52 additions and 2 deletions

11
test/CDB_QuotaTest.sql Normal file
View File

@@ -0,0 +1,11 @@
set client_min_messages to ERROR;
\set VERBOSITY terse
CREATE TABLE big(a int);
SELECT CDB_CartodbfyTable('big');
INSERT INTO big SELECT generate_series(1,1024);
SELECT CDB_SetUserQuotaInBytes(8);
INSERT INTO big VALUES (1);
SELECT CDB_SetUserQuotaInBytes(0);
INSERT INTO big VALUES (1);
DROP TABLE big;
set client_min_messages to NOTICE;

10
test/CDB_QuotaTest_expect Normal file
View File

@@ -0,0 +1,10 @@
SET
CREATE TABLE
INSERT 0 1024
0
ERROR: Quota exceeded by 103.9921875KB
8
INSERT 0 1
DROP TABLE
SET