Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1stCbx-00ELbZ-JY for pgsql-hackers@arkaria.postgresql.org; Tue, 24 Sep 2024 20:58:18 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1stCbv-00EM3i-CZ for pgsql-hackers@arkaria.postgresql.org; Tue, 24 Sep 2024 20:58:15 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1stCbv-00EM3Z-2P for pgsql-hackers@lists.postgresql.org; Tue, 24 Sep 2024 20:58:15 +0000 Received: from mail-io1-xd33.google.com ([2607:f8b0:4864:20::d33]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1stCbr-000tzU-I9 for pgsql-hackers@postgresql.org; Tue, 24 Sep 2024 20:58:14 +0000 Received: by mail-io1-xd33.google.com with SMTP id ca18e2360f4ac-82aa7c3b482so235726539f.2 for ; Tue, 24 Sep 2024 13:58:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727211491; x=1727816291; darn=postgresql.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=UhSoYhn4oL8bQXQ5GFrMs3SgpyIjIDVouAPW/JG0nQg=; b=PBhqSo1M6j4Gkq06ngsBrOvo471uPPeDMVYyvt7HQ7CKSp7O13P55IvmHIOaBzYNa8 qDcaTt8MU6nuIh9q2M3EgYiWW0isBYDz2v9pOWAg0y70j1GaK5dflnl1rUHOyqmFe5r7 9YkXI7LYBi4adMqW3JrI1Ll+MhtHc84D9wS7X7dtAmImr0UedLekI4U199ZPFNYWEXYX uWigqk2qFL+kwZepVljCS2UWvM70ly4Za4J45uTX9EkM4wuKGMLoTwsJcvkwiSji055z Cn/nBlCGcXcCgwBE9jB6jzhqMHG+VGpBT5hkGGJhpb1fu8YYaIhTk1RW8VrAzsXNndzI WRfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727211491; x=1727816291; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=UhSoYhn4oL8bQXQ5GFrMs3SgpyIjIDVouAPW/JG0nQg=; b=uPY8MlCZBIHOa4v9DJ9iSwBIcHmgnvPSrhPaI2rIs3fkJFWG946DeI3GtD7gQNsOoC NSr96TAwjthNCT3gbk2uXm6D1Nl0ji0SwiiskESFnVM8ITt/j56fbM4cP6D/GikCGRLC WmASnDegg6w/eiHfD1ndjU09ZaVK2YbTb2o6qDWMpBrx0H4bW2tlACgYSjBPSE3zmXcn KEeacpxV3Fsze5HtXDw/P61b1iYlROSJMaZIDcritU8pkarZLmWBX63TIIxhm1Duzi5G ZM4BvNzxeBgDz7I1JL+PPNnASHq4LColtM44Kd1aX7n+sWQ55oz1DlC95D3Me3wawkJY gq0A== X-Forwarded-Encrypted: i=1; AJvYcCWXSc40WHgAZLXnqDZHn0TK0Ugcld9VFfAcYR+N3WW9XRkddfRV/BkNoPf46qN26bMAflF9N/i1X4j3YDwM@postgresql.org X-Gm-Message-State: AOJu0Yz0jTxNCVCnlNEcr9sWI+imHyf6y+N50DhLocDZdocx6RG0P4jM FGtsEb4P4DFxLH2XxwOXZUvaQmwNEEvSjEpN1XtHwj7vt9s0jCxt X-Google-Smtp-Source: AGHT+IEuekFxUc5rsu2pEItYZJWPFgehDKCy7EwcbtQ6kPRguMmPAeJ5Jc1rsDrpPUiUi3f2zxr/VQ== X-Received: by 2002:a92:c269:0:b0:3a0:aac2:a0a4 with SMTP id e9e14a558f8ab-3a26d756e66mr8855475ab.9.1727211491102; Tue, 24 Sep 2024 13:58:11 -0700 (PDT) Received: from nathan (162-195-168-172.lightspeed.stlsmo.sbcglobal.net. [162.195.168.172]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-4d40f15033asm621516173.84.2024.09.24.13.58.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Sep 2024 13:58:10 -0700 (PDT) Date: Tue, 24 Sep 2024 15:58:08 -0500 From: Nathan Bossart To: Tom Lane Cc: Max Johnson , "pgsql-hackers@postgresql.org" Subject: Re: pg_ctl/miscinit: print "MyStartTime" as a long long instead of long to avoid 2038 problem. Message-ID: References: <3486094.1727210681@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3486094.1727210681@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, Sep 24, 2024 at 04:44:41PM -0400, Tom Lane wrote: > Nathan Bossart writes: >> I think we should use INT64_FORMAT here. That'll choose the right length >> modifier for the platform. And I don't think we need to cast MyStartTime, >> since it's a pg_time_t (which is just an int64). > > Agreed. However, a quick grep finds half a dozen other places that > are casting MyStartTime to long. We should fix them all. +1 > Also note that if any of the other places are using translatable > format strings, INT64_FORMAT is problematic in that context, and > "long long" is a better answer for them. At a glance, I'm not seeing any translatable format strings that involve MyStartTime. But that is good to know... -- nathan