Re: [INTERFACES] Time and microseconds?

From: Herouth Maoz <herouth(at)oumail(dot)openu(dot)ac(dot)il>
To: "Collin F(dot) Lynch" <clynch(at)water2(dot)cs(dot)umass(dot)edu>, pgsql-interfaces(at)postgreSQL(dot)org
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: [INTERFACES] Time and microseconds?
Date: 1999-07-04 10:10:17
Message-ID: l03130301b3a4db9b4387@[147.233.159.109]
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-interfaces

At 23:48 +0300 on 01/07/1999, Collin F. Lynch wrote:

> I'm having the peculiar problem That Postgres Seems unable to deal
>with microseconds in a time field. I have the field defined as type time,
>and postgres accepts input of the form 12:22:13.41 but appears to ose the
>microseconds withn the database itself?

It's just the output of the time datatype. This datatype is a bit odd. You
can see that the microseconds are kept. Compare:

testing=> select '12:05:11.04'::time;
?column?
--------
12:05:11
(1 row)

testing=> select datetime( 'today', '12:05:11.04'::time );
datetime
-------------------------------
Sun Jul 04 12:05:11.04 1999 IDT
(1 row)

So you see, the milliseconds are actually. It's just that it didn't show in
the normal display form.

The TIME datatype is supposed to be compatible with SQL92, but it's, well,
not exactly. Anyway, the default precision for time is 0, that is, no
fractions of seconds unless stated so explicitly. However, since it stores
milliseconds, it defies that definition.

Herouth

--
Herouth Maoz, Internet developer.
Open University of Israel - Telem project
http://telem.openu.ac.il/~herutma

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 1999-07-04 13:55:44 Re: [HACKERS] Tuple length limit
Previous Message Bruce Momjian 1999-07-04 05:04:46 Re: [HACKERS] Tuple length limit

Browse pgsql-interfaces by date

  From Date Subject
Next Message abdelkrim 1999-07-04 11:58:27 union and modification
Previous Message Tom Lane 1999-07-04 01:20:45 Re: triggers and NOTIFY