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.96) (envelope-from ) id 1vl4Xs-006b7W-2M for pgsql-hackers@arkaria.postgresql.org; Wed, 28 Jan 2026 12:21:17 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vl4Xr-001CoO-26 for pgsql-hackers@arkaria.postgresql.org; Wed, 28 Jan 2026 12:21:15 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vl4Xq-001CoG-29 for pgsql-hackers@lists.postgresql.org; Wed, 28 Jan 2026 12:21:15 +0000 Received: from fout-a1-smtp.messagingengine.com ([103.168.172.144]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vl4Xl-002jTE-17 for pgsql-hackers@lists.postgresql.org; Wed, 28 Jan 2026 12:21:14 +0000 Received: from phl-compute-03.internal (phl-compute-03.internal [10.202.2.43]) by mailfout.phl.internal (Postfix) with ESMTP id 84624EC0122 for ; Wed, 28 Jan 2026 07:21:08 -0500 (EST) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-03.internal (MEProxy); Wed, 28 Jan 2026 07:21:08 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kurilemu.de; h= cc:content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:message-id:mime-version:reply-to:subject :subject:to:to; s=fm1; t=1769602868; x=1769689268; bh=UQ1+WFVD4k ACXDhIwe2wGD8V9D08hWym/Z9gGnh2JIo=; b=L7v1jQNIhcJu1yhf0m5Fdb8JA7 h2SwEjndMWak4KsoJ44U3ndgGSjrTpa9HEekqzNWtytzzcr1n22MddchZYv2gFoC uffEcgbwYIFcouXC1QD0o6Enae1jGmLJjEPC7NVj4OaSsg+rNavRuYirpqUPxUoN pjNvY+3EGBzsaP2cCQV186YrMkW66wQvwKisrM2VWAGHpwRn8ufDDWI5p4abnFsu amTZLcNwWCQ1a7Yf6IYcGv+eB5X9i+QTA46CMglm3+7DxASKHHDygptiJTF7OmnA 2MD8dMMGqqS8cDgly/Y29Ytt9StASXSXfMWt/b/IsFBru42HDL77TOIXVO/A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:message-id:mime-version:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t= 1769602868; x=1769689268; bh=UQ1+WFVD4kACXDhIwe2wGD8V9D08hWym/Z9 gGnh2JIo=; b=Gp74ZWOB6VPt5B7OTJ2KfDaIzibuzzZH+mk2164iimj7GMBD/9l S8WBWOrdPTt1taQrkXF6ryS0higaRgjoMHwPx3nG5XV/HJRcx/oXFsaPlEkOP3HF obewtA7/1sQfJhHjA0VPvzGGa+P1PfBr8PYuj3ADNkRo3yDZO0k/BVGcrct0zhkb Mk+buVdQszpgpHyz3zAKJ+s82Ah5XC0z/Gfw/461+3EkA9MHCV1/8011/I/TzDjX IDS59D77A4mJCiG95xZjnzhLEyAyvLBk9nIlufCMTwDhIsV0DyWoKdwkXIUVCdLd 95dOCH5Ky8thT24u8w2gzERzLpNiYAtYAfA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgdduieeffeehucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf gurhepfffhvffukfggtggugfesmhekreertddtjeenucfhrhhomheplmhlvhgrrhhoucfj vghrrhgvrhgruceorghlvhhhvghrrhgvsehkuhhrihhlvghmuhdruggvqeenucggtffrrg htthgvrhhnpeefveegkedttdeiueegtefgkedvgeevudegveeukeejtdejveejtefhfeeu jeeggeenucffohhmrghinhepvghnthgvrhhprhhishgvuggsrdgtohhmnecuvehluhhsth gvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprghlvhhhvghrrhgvsehk uhhrihhlvghmuhdruggvpdhnsggprhgtphhtthhopedupdhmohguvgepshhmthhpohhuth dprhgtphhtthhopehpghhsqhhlqdhhrggtkhgvrhhssehlihhsthhsrdhpohhsthhgrhgv shhqlhdrohhrgh X-ME-Proxy: Feedback-ID: ie3de48e3:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Wed, 28 Jan 2026 07:21:07 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kurilemu.de; s=schmee; t=1769602856; bh=ad2Tr4ysA6owsvP5+Uer6UW44OzS5e/FcP7nk4OW98M=; h=Date:From:To:Subject:From; b=huCrHuxjSf7vVKp2LbbEndDB89t4GRO0lloFWX5WkzBN2wWKsU4xYHBs9MU6p9uqu IirIaTaYMk29pHJVv2+fQHIGTjWqSamKURQ73isjM/gPpPEtJuINv1x0LDdbDs9Wik 969byr7xbW5kRIPOLyPgOEdOCTxB06iRSsExA9fkHZWUUH5zPLZE4xtctEvz/Sw2hP MbZmXt8E2jQyzj2Q6qkL/eeNdxJJzeAtGl7n0LK11PXG6ooauS1evL1ujv7bgQo7dp S8dRo1P6CoXVYfcIBHGc+d4KFIAAZks2nhpyLmOeuv6fRyZcwoIQ/TN/HmZGK+3SFY 9h7fDu0f1D3zw== Received: by schmee.kurilemu.internal (Postfix, from userid 1000) id 228CB7A; Wed, 28 Jan 2026 13:20:56 +0100 (CET) Date: Wed, 28 Jan 2026 13:20:56 +0100 From: =?utf-8?Q?=C3=81lvaro?= Herrera To: Pg Hackers Subject: trivial designated initializers Message-ID: <202601281204.sdxbr5qvpunk@alvherre.pgsql> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="hedw4mraldmc2ejv" Content-Disposition: inline Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --hedw4mraldmc2ejv Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit Hi We use C99 designated struct initializers in many places, but for some reason we don't do it in the tupleLockExtraInfo array in heapam.c nor in InternalBGWorkers array in bgworker.c. I've had this trivial patch rotting in a worktree for a long time. Any opposition to this change? Thanks, -- Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/ "Postgres is bloatware by design: it was built to house PhD theses." (Joey Hellerstein, SIGMOD annual conference 2002) --hedw4mraldmc2ejv Content-Type: text/x-diff; charset=utf-8 Content-Disposition: attachment; filename="0001-use-C99-named-designators.patch" From 9b5827db4b9a2dba0de0f6272d93f54f3f5eff21 Mon Sep 17 00:00:00 2001 From: Alvaro Herrera Date: Wed, 23 Aug 2023 12:19:30 +0200 Subject: [PATCH] use C99 named designators --- src/backend/access/heap/heapam.c | 29 +++++++++++++++-------------- src/backend/postmaster/bgworker.c | 18 ++++++++++++------ 2 files changed, 27 insertions(+), 20 deletions(-) diff --git a/src/backend/access/heap/heapam.c b/src/backend/access/heap/heapam.c index f30a56ecf55..75a77052cd4 100644 --- a/src/backend/access/heap/heapam.c +++ b/src/backend/access/heap/heapam.c @@ -127,29 +127,30 @@ static const struct LOCKMODE hwlock; int lockstatus; int updstatus; -} +} tupleLockExtraInfo[] = - tupleLockExtraInfo[MaxLockTupleMode + 1] = { { /* LockTupleKeyShare */ - AccessShareLock, - MultiXactStatusForKeyShare, - -1 /* KeyShare does not allow updating tuples */ + .hwlock = AccessShareLock, + .lockstatus = MultiXactStatusForKeyShare, + /* KeyShare does not allow updating tuples */ + .updstatus = -1 }, { /* LockTupleShare */ - RowShareLock, - MultiXactStatusForShare, - -1 /* Share does not allow updating tuples */ + .hwlock = RowShareLock, + .lockstatus = MultiXactStatusForShare, + /* Share does not allow updating tuples */ + .updstatus = -1 }, { /* LockTupleNoKeyExclusive */ - ExclusiveLock, - MultiXactStatusForNoKeyUpdate, - MultiXactStatusNoKeyUpdate + .hwlock = ExclusiveLock, + .lockstatus = MultiXactStatusForNoKeyUpdate, + .updstatus = MultiXactStatusNoKeyUpdate }, { /* LockTupleExclusive */ - AccessExclusiveLock, - MultiXactStatusForUpdate, - MultiXactStatusUpdate + .hwlock = AccessExclusiveLock, + .lockstatus = MultiXactStatusForUpdate, + .updstatus = MultiXactStatusUpdate } }; diff --git a/src/backend/postmaster/bgworker.c b/src/backend/postmaster/bgworker.c index 65deabe91a7..51874481751 100644 --- a/src/backend/postmaster/bgworker.c +++ b/src/backend/postmaster/bgworker.c @@ -120,22 +120,28 @@ static const struct { { - "ParallelWorkerMain", ParallelWorkerMain + .fn_name = "ParallelWorkerMain", + .fn_addr = ParallelWorkerMain }, { - "ApplyLauncherMain", ApplyLauncherMain + .fn_name = "ApplyLauncherMain", + .fn_addr = ApplyLauncherMain }, { - "ApplyWorkerMain", ApplyWorkerMain + .fn_name = "ApplyWorkerMain", + .fn_addr = ApplyWorkerMain }, { - "ParallelApplyWorkerMain", ParallelApplyWorkerMain + .fn_name = "ParallelApplyWorkerMain", + .fn_addr = ParallelApplyWorkerMain }, { - "TableSyncWorkerMain", TableSyncWorkerMain + .fn_name = "TableSyncWorkerMain", + .fn_addr = TableSyncWorkerMain }, { - "SequenceSyncWorkerMain", SequenceSyncWorkerMain + .fn_name = "SequenceSyncWorkerMain", + .fn_addr = SequenceSyncWorkerMain } }; -- 2.47.3 --hedw4mraldmc2ejv--