From: glyn Date: Fri, 13 Feb 2015 16:31:29 +0000 (+0000) Subject: Add a note after looking at older plpgsql function X-Git-Url: https://git.8kb.co.uk/?a=commitdiff_plain;h=refs%2Fheads%2Fmaster;p=postgresql%2Fpg_update_chunks Add a note after looking at older plpgsql function --- 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'),'') || ';';