Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iyFRW-0007EB-8y for pgsql-general@arkaria.postgresql.org; Sun, 02 Feb 2020 13:37:42 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iyFRS-0000eg-9s for pgsql-general@arkaria.postgresql.org; Sun, 02 Feb 2020 13:37:38 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iyFRR-0000eY-PA for pgsql-general@lists.postgresql.org; Sun, 02 Feb 2020 13:37:37 +0000 Received: from mail.i-mark.de ([188.138.104.222]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1iyFRO-0001L2-VZ for pgsql-general@lists.postgresql.org; Sun, 02 Feb 2020 13:37:36 +0000 Received: from [192.168.178.20] (unknown [185.38.49.17]) by mail.i-mark.de (Postfix) with ESMTPSA id C67CE1584104 for ; Sun, 2 Feb 2020 14:37:27 +0100 (CET) Authentication-Results: loft7616.startdedicated.de; spf=pass (sender IP is 185.38.49.17) smtp.mailfrom=andreas@a-kretschmer.de smtp.helo=[192.168.178.20] Received-SPF: pass (loft7616.startdedicated.de: connection is authenticated) Subject: Re: How to avoid UPDATE on same data in table ? To: pgsql-general@lists.postgresql.org References: <1a25799e60c79c65575f6e6375c96a52@stz-bg.com> From: Andreas Kretschmer Message-ID: Date: Sun, 2 Feb 2020 14:37:30 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 In-Reply-To: <1a25799e60c79c65575f6e6375c96a52@stz-bg.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Am 02.02.20 um 10:24 schrieb Condor: > CREATE TRIGGER last_changes >   BEFORE UPDATE ON status_table >   FOR EACH ROW >   WHEN (OLD.* IS DISTINCT FROM NEW.*) try to exclude the column lastchange from the comparison. Andreas -- 2ndQuadrant - The PostgreSQL Support Company. www.2ndQuadrant.com