From 3398212ad7771d4e20536b40022d5c59f03723b4 Mon Sep 17 00:00:00 2001 From: glyn Date: Fri, 13 Feb 2015 16:31:29 +0000 Subject: [PATCH 1/1] Add a note after looking at older plpgsql function --- pg_chunk_update.plpgsql | 1 + 1 file changed, 1 insertion(+) diff --git a/pg_chunk_update.plpgsql b/pg_chunk_update.plpgsql index 0aeb80c..9c0e4c6 100755 --- a/pg_chunk_update.plpgsql +++ b/pg_chunk_update.plpgsql @@ -30,6 +30,7 @@ BEGIN PERFORM dblink_connect('chunk_updates', in_conninfo); + -- A lot of this could be switched out for format() in 9.1+ v_sql := 'SELECT count(*)/' || in_chunks || ' FROM ' || quote_ident(in_nspname) || '.' || quote_ident(in_relname) || ' WHERE ((' || in_fields || ') IS NULL OR (' || in_fields || ') <> (' || in_values || '))' || COALESCE(' AND ' || regexp_replace(in_where_clause, E'WHERE\\y','AND', 'i'),'') || ';'; -- 2.39.5