From 4cceb2a21f6abb3083a11368f2b5e48c6621e75d Mon Sep 17 00:00:00 2001 From: Luis Bosque Date: Tue, 17 Nov 2015 13:10:15 +0100 Subject: [PATCH] Revert "Optimize invalidation time logging" This reverts commit d1d5ed6df3ab75e71000f50adc0b235ffef0327b. --- scripts-available/CDB_TableMetadata.sql | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/scripts-available/CDB_TableMetadata.sql b/scripts-available/CDB_TableMetadata.sql index 858d36b..7eb22b7 100644 --- a/scripts-available/CDB_TableMetadata.sql +++ b/scripts-available/CDB_TableMetadata.sql @@ -67,7 +67,7 @@ DECLARE function_start timestamptz; function_end timestamptz; function_duration float; - log_error_verbosity_value text; + log_error_verbosity text; BEGIN IF TG_OP = 'UPDATE' or TG_OP = 'INSERT' THEN @@ -76,7 +76,7 @@ BEGIN tabname = OLD.tabname; END IF; - function_start := clock_timestamp(); + EXECUTE 'SELECT clock_timestamp()' INTO function_start; -- Notify table data update -- This needs a little bit more of research regarding security issues @@ -112,12 +112,13 @@ BEGIN END LOOP; IF NOT found THEN RAISE WARNING 'Missing cdb_invalidate_varnish()'; END IF; - function_end := clock_timestamp(); + EXECUTE 'SELECT clock_timestamp()' INTO function_end; 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'; + + EXECUTE 'SELECT setting FROM pg_settings where name=''log_error_verbosity''' INTO log_error_verbosity; SET log_error_verbosity=TERSE; RAISE LOG 'invalidation_duration: %', function_duration::text; - PERFORM 'SET log_error_verbosity= ' || log_error_verbosity_value; + EXECUTE 'SET log_error_verbosity= ' || log_error_verbosity; RETURN NULL; END;