Re: Remove one TimestampTzGetDatum call in pg_stat_get_io()

From: Bertrand Drouvot <bertranddrouvot(dot)pg(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Remove one TimestampTzGetDatum call in pg_stat_get_io()
Date: 2024-09-06 15:45:27
Message-ID: Ztsjl50ATH+s9bYz@ip-10-97-1-34.eu-west-3.compute.internal
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On Fri, Sep 06, 2024 at 11:40:56AM -0400, Tom Lane wrote:
> I wrote:
> > Hmm, TimestampTzGetDatum is not a no-op on 32-bit machines. If you're
> > correct about this, why are our 32-bit BF animals not crashing? Are
> > we failing to test this code?
>
> Oh, I had the polarity backwards: this error doesn't result in trying
> to dereference something that's not a pointer, but rather in
> constructing an extra indirection layer, with the end result being
> that the timestamp displayed in the pg_stat_io view is garbage
> (I saw output like "1999-12-31 19:11:45.880208-05" while testing in
> a 32-bit VM). It's not so surprising that our regression tests are
> insensitive to the values being displayed there.
>
> I confirm that this fixes the problem. Will push shortly.

Thanks! Yeah was going to reply that that would display incorrect results on
32-bit (and not crashing). And since the tests don't check the values then
we did not notice.

Regards,

--
Bertrand Drouvot
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2024-09-06 16:34:04 Re: [BUG?] XMLSERIALIZE( ... INDENT) won't work with blank nodes
Previous Message Tom Lane 2024-09-06 15:40:56 Re: Remove one TimestampTzGetDatum call in pg_stat_get_io()