Re: Feature improvement: can we add queryId for pg_catalog.pg_stat_activity view?

From: Julien Rouhaud <rjuju123(at)gmail(dot)com>
To: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
Cc: Bruce Momjian <bruce(at)momjian(dot)us>, Nitin Jadhav <nitinjadhavpostgres(at)gmail(dot)com>, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, Hannu Krosing <hannuk(at)google(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Michael Paquier <michael(at)paquier(dot)xyz>, torikoshia <torikoshia(at)oss(dot)nttdata(dot)com>, Atsushi Torikoshi <atorik(at)gmail(dot)com>, Tatsuro Yamada <tatsuro(dot)yamada(dot)tf(at)nttcom(dot)co(dot)jp>, Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>, Evgeny Efimkin <efimkin(at)yandex-team(dot)ru>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Feature improvement: can we add queryId for pg_catalog.pg_stat_activity view?
Date: 2021-04-08 12:12:54
Message-ID: 20210408121254.t2z5bi5zqr357r4r@nol
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Apr 08, 2021 at 11:36:48PM +1200, Thomas Munro wrote:
> Hi Julien, Bruce,
>
> A warning appears on 32 bit systems:
>
> In file included from pgstatfuncs.c:15:
> pgstatfuncs.c: In function 'pg_stat_get_activity':
> ../../../../src/include/postgres.h:593:29: warning: cast to pointer
> from integer of different size [-Wint-to-pointer-cast]
> 593 | #define DatumGetPointer(X) ((Pointer) (X))
> | ^
> ../../../../src/include/postgres.h:678:42: note: in expansion of macro
> 'DatumGetPointer'
> 678 | #define DatumGetUInt64(X) (* ((uint64 *) DatumGetPointer(X)))
> | ^~~~~~~~~~~~~~~
> pgstatfuncs.c:920:18: note: in expansion of macro 'DatumGetUInt64'
> 920 | values[29] = DatumGetUInt64(beentry->st_queryid);
> | ^~~~~~~~~~~~~~

Wow, that's really embarrassing :(

> Hmm, maybe this should be UInt64GetDatum()?

Yes definitely. I'm attaching the previous patch for force_parallel_mode to
not forget it + a new one for this issue.

Attachment Content-Type Size
v2-0001-Ignore-parallel-workers-in-pg_stat_statements.patch text/x-diff 1.5 KB
v2-0002-Fix-thinko-in-pg_stat_get_activity-when-retrievin.patch text/x-diff 812 bytes

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2021-04-08 12:16:07 Re: Feature improvement: can we add queryId for pg_catalog.pg_stat_activity view?
Previous Message Michael Paquier 2021-04-08 12:05:22 Re: PostgreSQL 14 Feature Freeze + Release Management Team (RMT)