Re: USECS_* constants undefined with float8 timestamps?

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: "Johann 'Myrkraverk' Oskarsson" <johann(at)2ndquadrant(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: USECS_* constants undefined with float8 timestamps?
Date: 2011-08-13 01:32:39
Message-ID: 201108130132.p7D1WdM12619@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Johann 'Myrkraverk' Oskarsson wrote:
> Bruce Momjian <bruce(at)momjian(dot)us> writes:
>
> > Robert Haas wrote:
> >> On Fri, Jul 29, 2011 at 11:18 AM, Johann 'Myrkraverk' Oskarsson
> >> <johann(at)2ndquadrant(dot)com> wrote:
> >> >
> >> > I just noticed that the USECS_* constants are not defined when
> >> > the server is compiled without integer dates and timestamps.
> [snip]
> >> 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.
>
> I found a use for them in PL/Java which detects at run-time whether
> the server is using floating point or integer dates. The simplest way
> was just to use magic numbers instead on the off chance it's compiled
> with a server using float dates.

OK, that is a good reason. Done for PG 9.2.

--
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

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2011-08-13 01:34:25 Re: pgbench internal contention
Previous Message Alex Hunsaker 2011-08-13 01:17:25 Re: PL/Perl Returned Array