Re: Floating-point timestamps versus Range Types - Mailing list pgsql-hackers

From James Cloos
Subject Re: Floating-point timestamps versus Range Types
Date
Msg-id m3fwvuujv2.fsf@jhcloos.com
Whole thread Raw
In response to Re: Floating-point timestamps versus Range Types  (Jeff Davis <pgsql@j-davis.com>)
Responses Re: Floating-point timestamps versus Range Types
List pgsql-hackers
>>>>> "JD" == Jeff Davis <pgsql@j-davis.com> writes:

JD> 2. Fix the input/output functions in a special mode for dump/reload,
JD> to make them true inverses.

JC> That can be done by supporting the %A printf(3)/scanf(3) format.

JD> I don't happen to see a %A format in the man page, but I doubt the
JD> output would look like a timestamp.

Modern printf(1) also supports it, so an easy example:

:; printf '%A\n' 3.1415926535897932384626433832795029
0XC.90FDAA22168C235P-2

%a is the same, but with miniscule letters.

It is the hex format of the float types, and defaults to exactly enough
precision.  The length modifier L makes %a expect a long double.

JD> And if it doesn't look like a timestamp, it violates the spirit of a
JD> logical dump of the data.

Point taken.  Had I read the whole thread before replying I would have
been reminded that the float timestamps were archaic; that avoids any
need of %A for timestamps.

That said, the possiblity of hex i/o format for the float datatypes
would be welcome.

-JimC
-- 
James Cloos <cloos@jhcloos.com>         OpenPGP: 1024D/ED7DAEA6


pgsql-hackers by date:

Previous
From: "Kevin Grittner"
Date:
Subject: Re: add label to enum syntax
Next
From: David Fetter
Date:
Subject: Tab completion for view triggers in psql