Re: [HACKERS] Floating-point timestamps versus Range Types

2010-10-25 Thread James Cloos
JD == Jeff Davis pg...@j-davis.com writes: JD 2. Fix the input/output functions in a special mode for dump/reload, JDto make them true inverses. That can be done by supporting the %A printf(3)/scanf(3) format. -JimC -- James Cloos cl...@jhcloos.com OpenPGP: 1024D/ED7DAEA6 --

Re: [HACKERS] Floating-point timestamps versus Range Types

2010-10-25 Thread Jeff Davis
On Mon, 2010-10-25 at 13:54 -0400, James Cloos wrote: JD == Jeff Davis pg...@j-davis.com writes: JD 2. Fix the input/output functions in a special mode for dump/reload, JDto make them true inverses. That can be done by supporting the %A printf(3)/scanf(3) format. I don't happen to

Re: [HACKERS] Floating-point timestamps versus Range Types

2010-10-25 Thread James Cloos
JD == Jeff Davis pg...@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

Re: [HACKERS] Floating-point timestamps versus Range Types

2010-10-25 Thread Tom Lane
James Cloos cl...@jhcloos.com writes: That said, the possiblity of hex i/o format for the float datatypes would be welcome. It's unportable, for two different reasons: 1. pg_dump output would become platform-specific. This is highly undesirable. 2. The printf specifiers you want us to rely

Re: [HACKERS] Floating-point timestamps versus Range Types

2010-10-25 Thread James Cloos
TL == Tom Lane t...@sss.pgh.pa.us writes: JC That said, the possiblity of hex i/o format for the float datatypes JC would be welcome. TL It's unportable, for two different reasons: TL 2. The printf specifiers you want us to rely on are not standard. They are in C99. TL 1. pg_dump output

Re: [HACKERS] Floating-point timestamps versus Range Types

2010-10-25 Thread Robert Haas
On Mon, Oct 25, 2010 at 4:35 PM, James Cloos cl...@jhcloos.com wrote: TL == Tom Lane t...@sss.pgh.pa.us writes: JC That said, the possiblity of hex i/o format for the float datatypes JC would be welcome. TL It's unportable, for two different reasons: TL 2. The printf specifiers you want us

Re: [HACKERS] Floating-point timestamps versus Range Types

2010-10-21 Thread Bruce Momjian
Robert Haas wrote: On Mon, Oct 18, 2010 at 2:29 PM, Jeff Davis pg...@j-davis.com wrote: A reasonable conversion path might be to offer integer timestamps using a different type name (e.g. inttimestamp) that always means integer timestamps. Then, they could convert using ALTER TABLE, then do

Re: [HACKERS] Floating-point timestamps versus Range Types

2010-10-21 Thread Greg Stark
On Thu, Oct 21, 2010 at 4:49 PM, Bruce Momjian br...@momjian.us wrote: One thing we have talked about is converting the page on read-in from the backend.  Since the timestamps are the same size as float or integer, that might be possible. Did we have a solution for the problem that

Re: [HACKERS] Floating-point timestamps versus Range Types

2010-10-21 Thread Bruce Momjian
Greg Stark wrote: On Thu, Oct 21, 2010 at 4:49 PM, Bruce Momjian br...@momjian.us wrote: One thing we have talked about is converting the page on read-in from the backend. ?Since the timestamps are the same size as float or integer, that might be possible. Did we have a solution for the

Re: [HACKERS] Floating-point timestamps versus Range Types

2010-10-21 Thread Tom Lane
Bruce Momjian br...@momjian.us writes: Greg Stark wrote: Did we have a solution for the problem that understanding which columns are timestamps requires having a tuple descriptor and parsing the every tuple? That seems like it would a) be slow and b) require a lot of high level code in the

Re: [HACKERS] Floating-point timestamps versus Range Types

2010-10-21 Thread Greg Stark
On Thu, Oct 21, 2010 at 7:24 PM, Tom Lane t...@sss.pgh.pa.us wrote:  Would we be willing to make such assumptions to support in-place upgrade of timestamps? If something like that is true (I'm not sure it is) then we could consider doing the equivalent of what we were talking about doing for

Re: [HACKERS] Floating-point timestamps versus Range Types

2010-10-21 Thread Robert Haas
On Thu, Oct 21, 2010 at 10:24 PM, Tom Lane t...@sss.pgh.pa.us wrote: Bruce Momjian br...@momjian.us writes: Greg Stark wrote: Did we have a solution for the problem that understanding which columns are timestamps requires having a tuple descriptor and parsing the every tuple? That seems like

Re: [HACKERS] Floating-point timestamps versus Range Types

2010-10-18 Thread Tom Lane
Andrew Dunstan and...@dunslane.net writes: On 10/17/2010 04:40 PM, Tom Lane wrote: ... That's assuming that we think there are no users who are depending on float timestamps for functionality (they have a wider range than int timestamps don't they?). Yes, they do. Maybe we need to look at

Re: [HACKERS] Floating-point timestamps versus Range Types

2010-10-18 Thread Robert Haas
On Mon, Oct 18, 2010 at 1:12 PM, Tom Lane t...@sss.pgh.pa.us wrote: IOW I don't think the range argument holds much water for keeping float timestamps alive.  The on-disk-compatibility argument does, though. Right. I think your argument that we should do nothing upthread is exactly right.

Re: [HACKERS] Floating-point timestamps versus Range Types

2010-10-18 Thread Jeff Davis
On Mon, 2010-10-18 at 14:06 -0400, Robert Haas wrote: Right. I think your argument that we should do nothing upthread is exactly right. OK. A more interesting question is whether and how we can ease the migration path from float timestamps to integer timestamps. Even without range types,

Re: [HACKERS] Floating-point timestamps versus Range Types

2010-10-18 Thread Tom Lane
Robert Haas robertmh...@gmail.com writes: A more interesting question is whether and how we can ease the migration path from float timestamps to integer timestamps. Even without range types, if someone does have a UNIQUE index on a timestamp column, could they get an error if they dump from a

Re: [HACKERS] Floating-point timestamps versus Range Types

2010-10-18 Thread Robert Haas
On Mon, Oct 18, 2010 at 2:29 PM, Jeff Davis pg...@j-davis.com wrote: A reasonable conversion path might be to offer integer timestamps using a different type name (e.g. inttimestamp) that always means integer timestamps. Then, they could convert using ALTER TABLE, then do an in-place upgrade.

Re: [HACKERS] Floating-point timestamps versus Range Types

2010-10-18 Thread Jeff Davis
On Mon, 2010-10-18 at 14:49 -0400, Tom Lane wrote: whereas an int-timestamp build sees these inputs as all the same. Thus, to get into trouble you'd need to have a unique index on data that conflicts at the microsecond scale but not at the tenth-of-a-microsecond scale. This seems implausible.

[HACKERS] Floating-point timestamps versus Range Types

2010-10-17 Thread Jeff Davis
I'm working on the design for Range Types for 9.1: http://wiki.postgresql.org/wiki/RangeTypes But I think that floating-point timestamps may pose a problem. In this thread: http://archives.postgresql.org/pgsql-bugs/2010-08/msg00378.php I pointed out that floating-point timestamps can

Re: [HACKERS] Floating-point timestamps versus Range Types

2010-10-17 Thread David E. Wheeler
On Oct 17, 2010, at 9:56 AM, Jeff Davis wrote: 3. Somehow deprecate floating point timestamps or make them unusable in conjunction with Range Types. I'm not sure if there is demand to keep them alive or not. +1 David -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To

Re: [HACKERS] Floating-point timestamps versus Range Types

2010-10-17 Thread Joshua D. Drake
On Sun, 2010-10-17 at 10:00 -0700, David E. Wheeler wrote: On Oct 17, 2010, at 9:56 AM, Jeff Davis wrote: 3. Somehow deprecate floating point timestamps or make them unusable in conjunction with Range Types. I'm not sure if there is demand to keep them alive or not. This seems the best

Re: [HACKERS] Floating-point timestamps versus Range Types

2010-10-17 Thread Tom Lane
Jeff Davis pg...@j-davis.com writes: What should be done? I see a few options: 1. Do nothing. Floating-point timestamps aren't the default, and the bug reports are likely to be few and far between (but those that encounter the bug are likely to be very frustrated). I'm for that one. Anybody

Re: [HACKERS] Floating-point timestamps versus Range Types

2010-10-17 Thread Tom Lane
Joshua D. Drake j...@commandprompt.com writes: The only major distribution that I know of that ships the deprecated configuration is RedHat/Fedora. I don't know when that will change. Red Hat switched to integer datetimes as of 8.4 ... just like upstream. Please don't imagine that you can

Re: [HACKERS] Floating-point timestamps versus Range Types

2010-10-17 Thread Jeff Davis
On Sun, 2010-10-17 at 16:17 -0400, Tom Lane wrote: I'm for that one. Anybody working with fractional float timestamps should already understand that they aren't exact. I can't see the value of expending any great amount of effort on this. OK. There is maybe some argument for removing the

Re: [HACKERS] Floating-point timestamps versus Range Types

2010-10-17 Thread Tom Lane
Jeff Davis pg...@j-davis.com writes: On Sun, 2010-10-17 at 16:17 -0400, Tom Lane wrote: There is maybe some argument for removing the float timestamp code altogether, but I think that that's probably premature. They were still the default in 8.3, and we are still supporting in-place upgrade

Re: [HACKERS] Floating-point timestamps versus Range Types

2010-10-17 Thread Andrew Dunstan
On 10/17/2010 04:40 PM, Tom Lane wrote: At the earliest, we could consider dropping them when we drop support for in-place upgrade from 8.3 --- not only direct upgrade, but through multiple pg_upgrade steps. That's assuming that we think there are no users who are depending on float

Re: [HACKERS] Floating-point timestamps versus Range Types

2010-10-17 Thread Joshua D. Drake
On Sun, 2010-10-17 at 16:27 -0400, Tom Lane wrote: Joshua D. Drake j...@commandprompt.com writes: The only major distribution that I know of that ships the deprecated configuration is RedHat/Fedora. I don't know when that will change. Red Hat switched to integer datetimes as of 8.4 ...

Re: [HACKERS] Floating-point timestamps versus Range Types

2010-10-17 Thread Greg Stark
On Sun, Oct 17, 2010 at 12:03 PM, Joshua D. Drake j...@commandprompt.com wrote: The only major distribution that I know of that ships the deprecated configuration is RedHat/Fedora. I don't know when that will change. If only we knew someone in Redhat :) iirc the issue was binary upgrades. So

Re: [HACKERS] Floating-point timestamps versus Range Types

2010-10-17 Thread Joshua D. Drake
On Sun, 2010-10-17 at 15:52 -0700, Greg Stark wrote: On Sun, Oct 17, 2010 at 12:03 PM, Joshua D. Drake j...@commandprompt.com wrote: The only major distribution that I know of that ships the deprecated configuration is RedHat/Fedora. I don't know when that will change. If only we knew