Re: USECS_* constants undefined with float8 timestamps?

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: "Johann 'Myrkraverk' Oskarsson" <johann(at)2ndquadrant(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: USECS_* constants undefined with float8 timestamps?
Date: 2011-08-12 21:28:15
Message-ID: 201108122128.p7CLSF422930@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Robert Haas wrote:
> On Fri, Jul 29, 2011 at 11:18 AM, Johann 'Myrkraverk' Oskarsson
> <johann(at)2ndquadrant(dot)com> wrote:
> > Hi all,
> >
> > I just noticed that the USECS_* constants are not defined when the server
> > is compiled without integer dates and timestamps.
> >
> > Explicitly, timestamp.h is
> >
> > #ifdef HAVE_INT64_TIMESTAMP
> > #define USECS_PER_DAY INT64CONST(86400000000)
> > #define USECS_PER_HOUR INT64CONST(3600000000)
> > #define USECS_PER_MINUTE INT64CONST(60000000)
> > #define USECS_PER_SEC INT64CONST(1000000)
> > #endif
> >
> > Is there a particular reason for this? ?Even with float8 timestamps
> > there are uses for these constants in extensions.
>
> I don't see any particular reason not define them unconditionally.

Well, they are only used by integer dates, so why expand their
visibility? The define does make it clear how they are used. I suppose
if someone wanted to use them outside that case, we could open them up.
It is true that with integer dates now the default, we might find that
someone introduces compile problems by using them outside the integer
dates scope.

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ It's impossible for everything to be true. +

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Kevin Grittner 2011-08-12 21:39:26 Re: index-only scans
Previous Message Merlin Moncure 2011-08-12 21:26:03 Re: Inserting heap tuples in bulk in COPY