Re: Floating-point timestamps versus Range Types

From: Greg Stark <gsstark(at)mit(dot)edu>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Bruce Momjian <bruce(at)momjian(dot)us>, Robert Haas <robertmhaas(at)gmail(dot)com>, Jeff Davis <pgsql(at)j-davis(dot)com>, Andrew Dunstan <andrew(at)dunslane(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Floating-point timestamps versus Range Types
Date: 2010-10-22 03:26:26
Message-ID: AANLkTinHXpDX1VbhG9k+aK9mL1fjMg+UUqDtn4f7oE67@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Oct 21, 2010 at 7:24 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)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
changes that require more space in the new version.

1. Backpatch a change that refuses to create new values of the prohibited type
2. Provide a tool which scans all the values in your old database and
ensures there are no values of the prohibited type
3. Only allow pg_migrator from the version that includes the backpatched check

We would also have to make sure the new version's integer timestamp
doesn't write out any instances that look valid float timestamps. We
could have a guc to disable this check if you have a tool that scans
all the pages and rewrites any old values.

I think #1 would be feasible if it's really as simple as checking the
high bit which I imagine is what you're hoping it is. I supose it
would require writing out a 0 or larger denormalized value which would
mean we wouldn't be able to handle values close to the epoch properly.
I suppose for timestamps that doesn't really matter since that's
precision we never really have anyways.

I'm not sure if the tool to rewrite all existing values is so feasible
though. Considering that the values could be stuck in the middle of
arrays or records or even custom data types. Also there's tintervals
and so on to worry about too.

--
greg

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2010-10-22 03:31:54 Re: Floating-point timestamps versus Range Types
Previous Message Greg Stark 2010-10-22 03:18:10 Re: Creation of temporary tables on read-only standby servers