pg.ddx.io pgsql-committers@postgresql.org mailing list archive
help / color / mirror / Atom feedpgsql: Fix union for pgstat message types
5+ messages / 3 participants
[nested] [flat]
* pgsql: Fix union for pgstat message types
@ 2019-05-01 10:34 Magnus Hagander <magnus@hagander.net>
0 siblings, 1 reply; 5+ messages in thread
From: Magnus Hagander @ 2019-05-01 10:34 UTC (permalink / raw)
To: pgsql-committers@lists.postgresql.org
Fix union for pgstat message types
The message type for temp files and for checksum failures were missing
from the union. Due to the coding style used there was no compiler error
when this happend. So change the code to actively use the union thereby
producing a compiler error if the same mistake happens again, suggested
by Tom Lane.
Author: Julien Rouhaud
Reported-By: Tomas Vondra
Discussion: https://postgr.es/m/20190430163328.zd4rrlnbvgaqlcdz@development
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/659e53498c3c04e4f400323c02bef98fe8d13ec8
Modified Files
--------------
src/backend/postmaster/pgstat.c | 41 ++++++++++++++++++++++-------------------
src/include/pgstat.h | 4 +++-
2 files changed, 25 insertions(+), 20 deletions(-)
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: pgsql: Fix union for pgstat message types
@ 2019-05-04 15:48 Tomas Vondra <tomas.vondra@2ndquadrant.com>
parent: Magnus Hagander <magnus@hagander.net>
0 siblings, 1 reply; 5+ messages in thread
From: Tomas Vondra @ 2019-05-04 15:48 UTC (permalink / raw)
To: Magnus Hagander <magnus@hagander.net>; +Cc: pgsql-committers@lists.postgresql.org
On Wed, May 01, 2019 at 10:34:52AM +0000, Magnus Hagander wrote:
>Fix union for pgstat message types
>
>The message type for temp files and for checksum failures were missing
>from the union. Due to the coding style used there was no compiler error
>when this happend. So change the code to actively use the union thereby
>producing a compiler error if the same mistake happens again, suggested
>by Tom Lane.
>
Should the tempfile bit be backported? That message was added in 9.2.
regards
--
Tomas Vondra http://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: pgsql: Fix union for pgstat message types
@ 2019-05-04 15:54 Tom Lane <tgl@sss.pgh.pa.us>
parent: Tomas Vondra <tomas.vondra@2ndquadrant.com>
0 siblings, 1 reply; 5+ messages in thread
From: Tom Lane @ 2019-05-04 15:54 UTC (permalink / raw)
To: Tomas Vondra <tomas.vondra@2ndquadrant.com>; +Cc: Magnus Hagander <magnus@hagander.net>; pgsql-committers@lists.postgresql.org
Tomas Vondra <tomas.vondra@2ndquadrant.com> writes:
> On Wed, May 01, 2019 at 10:34:52AM +0000, Magnus Hagander wrote:
>> Fix union for pgstat message types
> Should the tempfile bit be backported? That message was added in 9.2.
It's just cosmetic I think. The main point of having everything in
the union is to make sure the union's size/alignment are sufficient,
but the tempfile message isn't anywhere near creating an issue there.
regards, tom lane
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: pgsql: Fix union for pgstat message types
@ 2019-05-04 17:08 Magnus Hagander <magnus@hagander.net>
parent: Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 5+ messages in thread
From: Magnus Hagander @ 2019-05-04 17:08 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Tomas Vondra <tomas.vondra@2ndquadrant.com>; pgsql-committers@lists.postgresql.org
On Sat, May 4, 2019 at 5:54 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Tomas Vondra <tomas.vondra@2ndquadrant.com> writes:
> > On Wed, May 01, 2019 at 10:34:52AM +0000, Magnus Hagander wrote:
> >> Fix union for pgstat message types
>
> > Should the tempfile bit be backported? That message was added in 9.2.
>
> It's just cosmetic I think. The main point of having everything in
> the union is to make sure the union's size/alignment are sufficient,
> but the tempfile message isn't anywhere near creating an issue there.
>
That was my thought as well. It's really only needed when we add new
things, to make sure we don't make those mistakes again. And nobody should
be adding new pgstat messages in old branches.
--
Magnus Hagander
Me: https://www.hagander.net/ <http://www.hagander.net/;
Work: https://www.redpill-linpro.com/ <http://www.redpill-linpro.com/;
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: pgsql: Fix union for pgstat message types
@ 2019-05-04 20:04 Tomas Vondra <tomas.vondra@2ndquadrant.com>
parent: Magnus Hagander <magnus@hagander.net>
0 siblings, 0 replies; 5+ messages in thread
From: Tomas Vondra @ 2019-05-04 20:04 UTC (permalink / raw)
To: Magnus Hagander <magnus@hagander.net>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; pgsql-committers@lists.postgresql.org
On Sat, May 04, 2019 at 07:08:10PM +0200, Magnus Hagander wrote:
> On Sat, May 4, 2019 at 5:54 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
>
> Tomas Vondra <tomas.vondra@2ndquadrant.com> writes:
> > On Wed, May 01, 2019 at 10:34:52AM +0000, Magnus Hagander wrote:
> >> Fix union for pgstat message types
>
> > Should the tempfile bit be backported? That message was added in 9.2.
>
> It's just cosmetic I think. The main point of having everything in
> the union is to make sure the union's size/alignment are sufficient,
> but the tempfile message isn't anywhere near creating an issue there.
>
> That was my thought as well. It's really only needed when we add new
> things, to make sure we don't make those mistakes again. And nobody should
> be adding new pgstat messages in old branches.
Fine with me, I don't think the backbranches are broken. OTOH it's a
minor change that would make the code more similar.
regards
--
Tomas Vondra http://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
^ permalink raw reply [nested|flat] 5+ messages in thread
end of thread, other threads:[~2019-05-04 20:04 UTC | newest]
Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2019-05-01 10:34 pgsql: Fix union for pgstat message types Magnus Hagander <magnus@hagander.net>
2019-05-04 15:48 ` Tomas Vondra <tomas.vondra@2ndquadrant.com>
2019-05-04 15:54 ` Tom Lane <tgl@sss.pgh.pa.us>
2019-05-04 17:08 ` Magnus Hagander <magnus@hagander.net>
2019-05-04 20:04 ` Tomas Vondra <tomas.vondra@2ndquadrant.com>
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