Re: Fractions of seconds in timestamps - Mailing list pgsql-general

From rihad
Subject Re: Fractions of seconds in timestamps
Date
Msg-id 4F96C4EE.5060707@mail.ru
Whole thread Raw
In response to Fractions of seconds in timestamps  (rihad <rihad@mail.ru>)
List pgsql-general
On 04/24/2012 07:51 PM, rihad wrote:
> As PostgreSQL stores timestamps with a fractional part, does it mean that
> WHERE f BETWEEN '2012-04-23 00:00:00' AND '2012'04-23 23:59:59' might
> miss
> records with values of f equal to 23:59:59.1234 or so?
>

Answering to myself: depends on how timestamp was defined at table
creation time

time, timestamp, and interval accept an optional precision value p which
specifies the number of fractional digits retained in the seconds field.
By default, there is no explicit bound on precision. The allowed range
of p is from 0 to 6 for the timestamp and interval types..


As the columns in question were explicitly created as timestamp(0) in
the database, they store no fractional part, so no matter at which
moment during the 59-th second the column is updated, it's always
exactly 59-th.

pgsql-general by date:

Previous
From: Willy-Bas Loos
Date:
Subject: how robust are custom dumps?
Next
From: Emi Lu
Date:
Subject: Re: Simple way to get missing number