pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Herouth Maoz <herouth@oumail.openu.ac.il>
To: Collin F. Lynch <clynch@water2.cs.umass.edu>
To: pgsql-interfaces@postgreSQL.org
Cc: pgsql-hackers@postgreSQL.org
Subject: Re: [INTERFACES] Time and microseconds?
Date: Sun, 4 Jul 1999 13:10:17 +0300
Message-ID: <l03130301b3a4db9b4387@[147.233.159.109]> (raw)
In-Reply-To: <199907012048.QAA01725@water2.cs.umass.edu>

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





view thread (3+ messages)  latest in thread

Message-ID: <l03130301b3a4db9b4387@[147.233.159.109]>
Permalink:  ../l03130301b3a4db9b4387@%5B147.233.159.109%5D/
Also on:    postgresql.org/message-id/l03130301b3a4db9b4387@[147.233.159.109]

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-interfaces@postgresql.org
  Cc: herouth@oumail.openu.ac.il, clynch@water2.cs.umass.edu, pgsql-hackers@postgreSQL.org
  Subject: Re: [INTERFACES] Time and microseconds?
  In-Reply-To: <l03130301b3a4db9b4387@[147.233.159.109]>
  References: <199907012048.QAA01725@water2.cs.umass.edu> <l03130301b3a4db9b4387@[147.233.159.109]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox