Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id C19514762A1 for ; Tue, 17 Sep 2002 12:19:41 -0400 (EDT) Received: from 100m.mpr200-1.esr.lvcm.net (100m.mpr200-1.esr.lvcm.net [24.234.0.78]) by postgresql.org (Postfix) with ESMTP id 28F1B47628F for ; Tue, 17 Sep 2002 12:19:41 -0400 (EDT) Received: from tux.lvcablemodem.com (cm017.58.234.24.lvcm.com [24.234.58.17]) by 100m.mpr200-1.esr.lvcm.net (Mirapoint Messaging Server MOS 2.9.3.5) with ESMTP id ALP32814; Tue, 17 Sep 2002 09:19:45 -0700 (PDT) Received: from marchpr by tux.lvcablemodem.com with local (Exim 3.35 #1 (Debian)) id 17rKx4-0005RR-00 for ; Tue, 17 Sep 2002 09:11:50 -0700 Date: Tue, 17 Sep 2002 09:11:50 -0700 From: Pat Marchant To: pgsql-odbc@postgresql.org Subject: Re: Problem w/trigger Message-ID: <20020917161150.GA20876@btree.net> References: <20020916220114.GA15063@btree.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20020916220114.GA15063@btree.net> User-Agent: Mutt/1.4i X-message-flag: Outlook: A virus that also does mail X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200209/76 X-Sequence-Number: 2047 Solved my own problem. The function the trigger was calling was using 'now'::datetime to get the timestamp. I changed that to CURRENT_TIMESTAMP and it worked. I don't know why it was working in psql by not in ODBC. Something to do with the function being cached? On Mon, Sep 16, 2002 at 03:01:14PM -0700, Pat Marchant wrote: > I have several tables that use a trigger to automatically > update a timestamp field when a record is modified. The trigger > works fine using psql. When I connect using ODBC, a > modified record is always updated with the time that I > connected to the server - not the current time. > > For example, if I connect to the database at > '2002-09-16 13:45:16-07' every record I change will have this > timestamp. I know the trigger is executing because if I modify > the record from the server console the record will have the > current time in the timestamp field - then if I change it > again from ODBC it will revert back to the old timestamp. > > What's going on?