Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WpK9b-0005ra-I3 for pgsql-sql@arkaria.postgresql.org; Tue, 27 May 2014 16:23:07 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1WpK9b-00033a-0B for pgsql-sql@arkaria.postgresql.org; Tue, 27 May 2014 16:23:07 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1WpK9Z-000318-Nf for pgsql-sql@postgresql.org; Tue, 27 May 2014 16:23:05 +0000 Received: from email.noao.edu ([140.252.1.57]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WpK9W-0002a5-NC for pgsql-sql@postgresql.org; Tue, 27 May 2014 16:23:03 +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 87112748; Tue, 27 May 2014 09:23:01 -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 s4RGN1us014014; Tue, 27 May 2014 09:23:01 -0700 Message-ID: <5384BBE5.5020409@noao.edu> Date: Tue, 27 May 2014 09:23:01 -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: Andreas Kretschmer , Postgres-SQL Subject: Re: Set flag column on update if other columns change? References: <5384B683.9030505@noao.edu> <1124372711.31798.1401207718005.open-xchange@oxweb02.ims-firmen.de> In-Reply-To: <1124372711.31798.1401207718005.open-xchange@oxweb02.ims-firmen.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -1.2 (-) 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 On 05/27/2014 09:21 AM, Andreas Kretschmer wrote: >> Steve Wampler hat am 27. Mai 2014 um 18:00 geschrieben: >> 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.). > > Trigger BEFORE, compare NEW. with OLD.. Easy. Thanks! I didn't know about OLD... -- 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