Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dXEgF-0005Ay-9t for pgsql-hackers@arkaria.postgresql.org; Mon, 17 Jul 2017 22:39:55 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1dXEgE-00013U-MN for pgsql-hackers@arkaria.postgresql.org; Mon, 17 Jul 2017 22:39:54 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dXEgE-00013K-2k for pgsql-hackers@postgresql.org; Mon, 17 Jul 2017 22:39:54 +0000 Received: from mail-qk0-x232.google.com ([2607:f8b0:400d:c09::232]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1dXEg7-00086u-7R for pgsql-hackers@postgresql.org; Mon, 17 Jul 2017 22:39:52 +0000 Received: by mail-qk0-x232.google.com with SMTP id t2so215503qkc.1 for ; Mon, 17 Jul 2017 15:39:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=EHf59fcfZY1msBhIWNvEuOPmj9kWmvg2vDinH6/6mCo=; b=R/JMmD3YN5TN9sP8BxWHhRO2o7oiOY2AD5y9KEPSuGQtsjYG7ONopyoRAiv3cmUPgn 9njJd6JnZS/nvYJm3KE3ysET0eaKCBvSSfPX9q+qAdxwGCF/OfMHXIRhUazi9rb3s/cX VTHhJlh7dHRrlmoPTjorZY8iUnoUS38gkBwI1wi1e9YNZ5tpS15OckdAyMRwul+y4AJq k9g1mIAOLU5HDcfd2BuQtuXLz1rEBUz6RqZ+9AslFTbs1Id4WxcAmP3sKI6PNQP7cVPW RYtcjJj1cjSI3K4J+EJtxNyDQQbaL1EkA6HY9OxZm5Uc03M6XC+l4NLVCSqEK+nebHuu 8MOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=EHf59fcfZY1msBhIWNvEuOPmj9kWmvg2vDinH6/6mCo=; b=UIFVPxovM5u7n9NrF7fRX4nW+ZNTyluNUl3q86W1ViWg1URiHuSJvWUoh4AonSTJ18 3NI4Zaa1Ba+AHGRT1vv6Zco9qn0bBxOT+4UWGrowioAF8/mgf1KJJnBy+qtAQcjs5bFc 24NuBKQW+PRybfFzL+inaWccdORHkq+4uTzNzbzQmNIFXYpbRgurhMqRUDuVOSll5hw+ fVOqBclyV5jvguZXCMQosOz/SEDMXr2ofvNj/Xk5qCgP5+YbxXnQe/zIN44S5k+JlGiU fJ0ICZzOFsGDm9gqKSJi/5OYec0mDsBeTA5sWhj1ldj0v8jLeGWPPY+sZALDEJE3KwOT Wp3w== X-Gm-Message-State: AIVw110zEqtHdtna4lBoOddXpkd4EneM+2G3M8/rU6NeJ5r4sCFIttzi ZZ6NFtMpUr2sLg== X-Received: by 10.55.73.195 with SMTP id w186mr30808997qka.249.1500331186114; Mon, 17 Jul 2017 15:39:46 -0700 (PDT) Received: from [192.168.2.121] ([172.92.221.196]) by smtp.gmail.com with ESMTPSA id m2sm331804qte.53.2017.07.17.15.39.45 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 17 Jul 2017 15:39:45 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: Something for the TODO list: deprecating abstime and friends From: Mark Dilger In-Reply-To: <14969.1500329527@sss.pgh.pa.us> Date: Mon, 17 Jul 2017 15:39:44 -0700 Cc: pgsql-hackers@postgresql.org Content-Transfer-Encoding: 7bit Message-Id: <4EAF23D0-8505-4517-B7B4-C22FEE89C97B@gmail.com> References: <30691.1500156034@sss.pgh.pa.us> <3D60B97C-5E80-4343-9CCF-390CD23B0E23@gmail.com> <3CD79F5D-DB73-4F2A-B698-44FF1930CB97@gmail.com> <12814.1500326041@sss.pgh.pa.us> <14969.1500329527@sss.pgh.pa.us> To: Tom Lane X-Mailer: Apple Mail (2.3124) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org > On Jul 17, 2017, at 3:12 PM, Tom Lane wrote: > > Mark Dilger writes: >>> On Jul 17, 2017, at 2:14 PM, Tom Lane wrote: >>> Well, if you or somebody is willing to do the legwork, I'd be on board >>> with a plan that says that every 68 years we redefine the origin of >>> abstime. I imagine it could be done so that currently-stored abstime >>> values retain their present meaning as long as they're not too old. >>> For example the initial change would toss abstimes before 1970 overboard, >>> repurposing that range of values as being 2038-2106, but values between >>> 1970 and 2038 still mean the same as they do today. If anybody still >>> cares in circa 2085, we toss 1970-2038 overboard and move the origin >>> again, lather rinse repeat. > >> Assuming other members of the community would not object to such >> a plan, I'd be willing to step up to that plate. > > So, thinking about how that would actually work ... the thing to do in > order to preserve existing on-disk values is to alternate between signed > and unsigned interpretations of abstimes. That is, right now, abstime > is signed with origin 1970. The conversion I'm arguing we should make > real soon now is to unsigned with origin 1970. If the project lives > so long, in circa 70 years we'd switch it to signed with origin 2106. > Yadda yadda. Right, I already had the same idea. That's not how I am doing it in my fork currently, but that's what you would want to do to support any values already stored somewhere. > Now, this should mostly work conveniently, except that we have > +/-infinity (NOEND_ABSTIME/NOSTART_ABSTIME) to deal with. Those > are nicely positioned at the ends of the signed range so that > abstime_cmp_internal() doesn't need to treat them specially. > In an unsigned world they'd be smack in the middle of the range. > We could certainly teach abstime_cmp_internal to special-case them > and deliver logically correct results, but there's a bigger problem: > those will correspond to two seconds in January 2038 that will need > to be representable when the time comes. Maybe we can make that > work by defining the values past 2038 as being two seconds less than > you might otherwise expect, but I bet it's gonna be messy. It might > be saner to just desupport +/-infinity for abstime. I don't use those values, so it is no matter to me if we desupport them. It seems a bit pointless, though, because we still have to handle legacy values that we encounter. I assume some folks will have those values in their tables when they upgrade. > The same goes for INVALID_ABSTIME, which doesn't have any clear > use-case that I know of, and is certainly not documented. Likewise, I don't know how to desupport this while still supporting legacy tables. mark -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers