Compare commits

...

5 Commits

Author SHA1 Message Date
Luis Bosque
cf2587ca54 New version 0.11.2 2015-10-19 14:35:10 +02:00
Luis Bosque
d1d5ed6df3 Optimize invalidation time logging 2015-10-19 14:09:52 +02:00
Luis Bosque
37160c7b35 Write invalidation duration in postgresql log 2015-10-16 18:23:18 +02:00
Alejandro Martínez
811c7474de Merge pull request #170 from CartoDB/fix-schema-group-sequence
Fix schema not being specified on pg_get_serial_sequence
2015-10-15 17:39:46 +02:00
Alejandro Martínez
1f63811383 Fix schema not being specified on pg_get_serial_sequence 2015-10-06 18:09:37 +02:00
4 changed files with 22 additions and 3 deletions

View File

@@ -1,7 +1,7 @@
# cartodb/Makefile
EXTENSION = cartodb
EXTVERSION = 0.11.1
EXTVERSION = 0.11.2
SED = sed
@@ -52,6 +52,7 @@ UPGRADABLE = \
0.10.2 \
0.11.0 \
0.11.1 \
0.11.2 \
$(EXTVERSION)dev \
$(EXTVERSION)next \
$(END)

View File

@@ -1,6 +1,11 @@
next (2015-mm-dd)
-----------------
0.11.2 (2015-10-19)
-------------------
* Fix schema not being specified on pg_get_serial_sequence [#170](https://github.com/CartoDB/cartodb-postgresql/pull/170)
* Log invalidation function call duration in seconds [#163](https://github.com/CartoDB/cartodb-postgresql/pull/163)
0.11.1 (2015-10-06)
-------------------
* Added CDB_DateToNumber(timestamp with time zone) [#169](https://github.com/CartoDB/cartodb-postgresql/pull/169)

View File

@@ -163,7 +163,7 @@ BEGIN
group_role := cartodb._CDB_Group_GroupRole(group_name);
FOR column_name IN EXECUTE 'SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_CATALOG = current_database() AND TABLE_SCHEMA = $1 AND TABLE_NAME = $2 AND COLUMN_DEFAULT LIKE ''nextval%''' USING username, table_name
LOOP
EXECUTE 'SELECT PG_GET_SERIAL_SEQUENCE($1, $2)' USING table_name, column_name INTO sequence_name;
EXECUTE format('SELECT PG_GET_SERIAL_SEQUENCE(''%I.%I'', ''%I'')', username, table_name, column_name) INTO sequence_name;
IF sequence_name IS NOT NULL THEN
IF do_grant THEN
-- Here %s is needed since sequence_name has quotes

View File

@@ -64,6 +64,10 @@ DECLARE
tabname TEXT;
rec RECORD;
found BOOL;
function_start timestamptz;
function_end timestamptz;
function_duration float;
log_error_verbosity_value text;
BEGIN
IF TG_OP = 'UPDATE' or TG_OP = 'INSERT' THEN
@@ -72,6 +76,8 @@ BEGIN
tabname = OLD.tabname;
END IF;
function_start := clock_timestamp();
-- Notify table data update
-- This needs a little bit more of research regarding security issues
-- see https://github.com/CartoDB/cartodb/pull/241
@@ -105,7 +111,14 @@ BEGIN
EXIT;
END LOOP;
IF NOT found THEN RAISE WARNING 'Missing cdb_invalidate_varnish()'; END IF;
function_end := clock_timestamp();
SELECT extract(epoch from (function_end - function_start)) INTO function_duration;
SELECT setting INTO log_error_verbosity_value FROM pg_settings WHERE name='log_error_verbosity';
SET log_error_verbosity=TERSE;
RAISE LOG 'invalidation_duration: %', function_duration::text;
PERFORM 'SET log_error_verbosity= ' || log_error_verbosity_value;
RETURN NULL;
END;
$$