Re: c function returning high resolution timestamp

From: Ron Peterson <ron(dot)peterson(at)yellowbank(dot)com>
To: Andreas Seltenreich <andreas+pg(at)gate450(dot)dyndns(dot)org>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: c function returning high resolution timestamp
Date: 2006-10-20 14:09:50
Message-ID: 20061020140950.GA8608@yellowbank.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, Oct 20, 2006 at 03:32:05PM +0200, Andreas Seltenreich wrote:
> Ron Peterson writes:
>
> > On Wed, Oct 18, 2006 at 04:43:40PM -0400, Ron Peterson wrote:
> > I'm pretty close, but I'm still not understanding something about
> > PostgreSQL's internal timestamp representation. If I do 'select
> > now();', I get a return value with microsecond resolution, which would
> > seem to indicate that internally, PostgreSQL is using an INT64 value
> > rather than a float to hold the timestamp.
>
> Floating point timestamps /do/ have microsecond resolution over a
> limited range:
>
> ,----[ <http://www.postgresql.org/docs/8.1/static/datatype-datetime.html> ]
> | Microsecond precision is achieved for dates within a few years of
> | 2000-01-01, but the precision degrades for dates further away. When
> | timestamp values are stored as eight-byte integers (a compile-time
> | option), microsecond precision is available over the full range of
> | values.
> `----

Ahah! Pghghtht, I've read that page many times, but never looking for
programming information. Not a problem with the way the docs are
organized, just a problem with the way my brain is organized. Thanks
for taking the time to help a slow learner.

Working code is posted here:

http://www.yellowbank.com/code/PostgreSQL/y_uuid/

--
Ron Peterson
https://www.yellowbank.com/

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Oisin Glynn 2006-10-20 14:12:06 Re: [professionel] Re: division by zero error in a request
Previous Message Ray Stell 2006-10-20 14:07:55 Re: why not kill -9 postmaster