Re: Floating-point timestamps versus Range Types

From: James Cloos <cloos(at)jhcloos(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Cc: Jeff Davis <pgsql(at)j-davis(dot)com>
Subject: Re: Floating-point timestamps versus Range Types
Date: 2010-10-25 19:56:09
Message-ID: m3fwvuujv2.fsf@jhcloos.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

>>>>> "JD" == Jeff Davis <pgsql(at)j-davis(dot)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(at)jhcloos(dot)com> OpenPGP: 1024D/ED7DAEA6

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David Fetter 2010-10-25 20:01:23 Tab completion for view triggers in psql
Previous Message Kevin Grittner 2010-10-25 19:52:59 Re: add label to enum syntax