Re: timestamp in 7.1 vs 7.2

From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: Chris Gamache <cgg007(at)yahoo(dot)com>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: timestamp in 7.1 vs 7.2
Date: 2002-05-08 20:34:05
Message-ID: 20020508133059.S1837-100000@megazone23.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, 8 May 2002, Chris Gamache wrote:

> data=# begin work;
> BEGIN
> data=# create temporary table tstest (tsvalue timestamp);
> CREATE
> data=# insert into tstest (tsvalue) values (current_timestamp);
> INSERT 29700913 1
> data=# select * from tstest;
> tsvalue
> -------------------------------
> 2002-05-08 13:34:23.809817-04
> (1 row)
>
> data=# select * from tstest where tsvalue='5/8/02 1:34:23 PM'::timestamp;
> tsvalue
> ---------
> (0 rows)
> =========================================
>
> It seems like we now have microseconds to deal with in the timestamp from 7.1.
> (Or I've just been doing most of my timestamp processing on the client-end as
> opposed to letting postgresql set them. never gave it the chance to not match
> up...)
>
> Unfortunately, ODBC reformats the timestamp to something similar to the above
> select...where statement. Can I cast current_timestamp to truncate the
> microseconds?

I believe you can make the column timestamp(0) which will give the
precision you want or insert current_timestamp(0).

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Ron Snyder 2002-05-08 20:39:14 Re: timestamp in 7.1 vs 7.2
Previous Message Holger Marzen 2002-05-08 20:01:05 Re: Performance issues with compaq server