Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WpJnS-00057A-TS for pgsql-sql@arkaria.postgresql.org; Tue, 27 May 2014 16:00:15 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1WpJnS-0007UX-1I for pgsql-sql@arkaria.postgresql.org; Tue, 27 May 2014 16:00:14 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1WpJnR-0007T0-0j for pgsql-sql@postgresql.org; Tue, 27 May 2014 16:00:13 +0000 Received: from email.noao.edu ([140.252.1.57]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WpJnL-0008SD-2k for pgsql-sql@postgresql.org; Tue, 27 May 2014 16:00:11 +0000 Received: from weaver.tuc.noao.edu ([140.252.14.8] verified) by email.noao.edu (CommuniGate Pro SMTP 6.0.9) with ESMTPS id 87112346; Tue, 27 May 2014 09:00:03 -0700 Received: from weaver.tuc.noao.edu (localhost.localdomain [127.0.0.1]) by weaver.tuc.noao.edu (8.14.4/8.14.4) with ESMTP id s4RG03C9012866; Tue, 27 May 2014 09:00:03 -0700 Message-ID: <5384B683.9030505@noao.edu> Date: Tue, 27 May 2014 09:00:03 -0700 From: Steve Wampler User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: Postgres-SQL Subject: Set flag column on update if other columns change? Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-sql Precedence: bulk Sender: pgsql-sql-owner@postgresql.org I've got a table where updates that actually change things need to record in the row that the row has been modified. I'm assuming that a trigger function (OK to be plpgsql, performance isn't much of an issue) is the best way to do this, but haven't done much with trigger functions. Can someone give me some pointers on how this might be accomplished? I have to check for changes in a subset of the columns (e.g. ignore timestamps, etc.). Thanks in advance! Steve -- Steve Wampler -- swampler@noao.edu The gods that smiled on your birth are now laughing out loud. -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql