Re: Problem w/trigger

From: Pat Marchant <pat(at)btree(dot)net>
To: pgsql-odbc(at)postgresql(dot)org
Subject: Re: Problem w/trigger
Date: 2002-09-17 16:11:50
Message-ID: 20020917161150.GA20876@btree.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-odbc

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?

In response to

Browse pgsql-odbc by date

  From Date Subject
Next Message Marc Birkett 2002-09-18 07:04:33 unsubsribe
Previous Message Hiroshi Inoue 2002-09-17 09:45:38 Re: datetime and ODBC driver