Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
0.35.0 (XXXX-XX-XX)
* Reapply the changes in 0.33.0 (the issue we were looking for was unrelated)
* Reapply `Make PG12 depend on plpython3u instead of plpythonu`
* Fix identifier quotation in `CDB_UserDataSize`

0.34.0 (2019-12-23)
* Revert changes done in 0.33.0, keeping function signature to drop them
Expand Down
6 changes: 3 additions & 3 deletions scripts-available/CDB_Quota.sql
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ BEGIN

IF raster_available THEN
raster_read_query := Format('SELECT o_table_name, r_table_name FROM @[email protected]_overviews
WHERE o_table_schema = ''%I'' AND o_table_catalog = current_database()', schema_name);
WHERE o_table_schema = %L AND o_table_catalog = current_database()', schema_name);
ELSE
raster_read_query := 'SELECT NULL::text AS o_table_name, NULL::text AS r_table_name';
END IF;
Expand All @@ -42,7 +42,7 @@ BEGIN
%s
),
user_tables AS (
SELECT table_name FROM @extschema@._CDB_NonAnalysisTablesInSchema(''%I'')
SELECT table_name FROM @extschema@._CDB_NonAnalysisTablesInSchema(%L)
),
table_cat AS (
SELECT
Expand All @@ -55,7 +55,7 @@ BEGIN
FROM user_tables
),
sizes AS (
SELECT COALESCE(INT8(SUM(@extschema@._CDB_total_relation_size(''%I'', table_name)))) table_size,
SELECT COALESCE(INT8(SUM(@extschema@._CDB_total_relation_size(%L, table_name)))) table_size,
CASE
WHEN is_overview THEN 0
WHEN is_raster THEN 1
Expand Down
3 changes: 3 additions & 0 deletions test/CDB_QuotaTest.sql
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ SELECT 'excess3', catch_error($$INSERT INTO big VALUES (3);$$); -- disallowed, q
DROP TABLE big;
SELECT CDB_SetUserQuotaInBytes(0);

CREATE SCHEMA "complex-name%_with'quotes""";
SELECT CDB_UserDataSize('"complex-name%_with''quotes"');
DROP SCHEMA "complex-name%_with'quotes""";

set client_min_messages to NOTICE;
DROP FUNCTION catch_error(text);
Expand Down
3 changes: 3 additions & 0 deletions test/CDB_QuotaTest_expect
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ DROP TABLE
excess3|t
DROP TABLE
0
CREATE SCHEMA
0
DROP SCHEMA
SET
DROP FUNCTION
DROP FUNCTION