Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1XgdYZ-0004nh-Cw for pgsql-bugs@arkaria.postgresql.org; Tue, 21 Oct 2014 17:49:15 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1XgdYY-0008Ig-U7 for pgsql-bugs@arkaria.postgresql.org; Tue, 21 Oct 2014 17:49:14 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1XgdYX-0008IN-Ta for pgsql-bugs@postgresql.org; Tue, 21 Oct 2014 17:49:14 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1XgdYU-0005JC-MI for pgsql-bugs@postgresql.org; Tue, 21 Oct 2014 17:49:12 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id s9LHn2od007563; Tue, 21 Oct 2014 13:49:02 -0400 From: Tom Lane To: John R Pierce cc: pgsql-bugs@postgresql.org Subject: Re: 32 bit libpq fail to connecting when set a very large "connect_timeout" value In-reply-to: <544690D6.1030904@hogranch.com> References: <75f4618f.c0f7.1492c250468.Coremail.chjischj@163.com> <3051.1413813229@sss.pgh.pa.us> <5e02241f.e1dd.1493378083f.Coremail.chjischj@163.com> <544690D6.1030904@hogranch.com> Comments: In-reply-to John R Pierce message dated "Tue, 21 Oct 2014 09:59:02 -0700" Date: Tue, 21 Oct 2014 13:49:02 -0400 Message-ID: <7562.1413913742@sss.pgh.pa.us> X-Pg-Spam-Score: -3.3 (---) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org John R Pierce writes: > On 10/21/2014 9:09 AM, chenhj wrote: >> Currently PG has assumed time_t's are positive, didn't it? > IIRC, time_t is an unsigned int. If it were, Unix programs couldn't deal with dates before 1970. Originally time_t was usually a signed 32-bit int, allowing a range of dates from about 1901 to 2038. There were proposals at one time to "fix" the Y2038 problem by redefining time_t as unsigned 32-bit, which would kick the can down the road another 70 years at the price of breaking pre-1970 dates. But I think this idea has mostly fallen by the wayside in favor of migrating to 64-bit-signed time_t. On my Linux box, it looks like time_t is defined as "long int", which means problem solved on 64-bit machines. If anyone is still using 32-bit hardware in 2038, they're probably going to have to endure an ABI break to widen time_t to int64. regards, tom lane -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs