pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Nathan Bossart <nathandbossart@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Max Johnson <max.johnson@novatechautomation.com>
Cc: pgsql-hackers@postgresql.org <pgsql-hackers@postgresql.org>
Subject: Re: pg_ctl/miscinit: print "MyStartTime" as a long long instead of long to avoid 2038 problem.
Date: Tue, 24 Sep 2024 15:58:08 -0500
Message-ID: <ZvMn4K2PO2_7iavy@nathan> (raw)
In-Reply-To: <3486094.1727210681@sss.pgh.pa.us>
References: <CO1PR07MB905262E8AC270FAAACED66008D682@CO1PR07MB9052.namprd07.prod.outlook.com>
	<ZvMghxsFyYM9e9kT@nathan>
	<3486094.1727210681@sss.pgh.pa.us>

On Tue, Sep 24, 2024 at 04:44:41PM -0400, Tom Lane wrote:
> Nathan Bossart <nathandbossart@gmail.com> 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





view thread (14+ messages)  latest in thread

Message-ID: <ZvMn4K2PO2_7iavy@nathan>
Permalink:  ../ZvMn4K2PO2_7iavy@nathan/
Also on:    postgresql.org/message-id/ZvMn4K2PO2_7iavy@nathan

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: nathandbossart@gmail.com, tgl@sss.pgh.pa.us, max.johnson@novatechautomation.com
  Subject: Re: pg_ctl/miscinit: print "MyStartTime" as a long long instead of long to avoid 2038 problem.
  In-Reply-To: <ZvMn4K2PO2_7iavy@nathan>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox