Subject: pg_plan_advice: rtekind uninitialized compilation waning

From: Sami Imseih <[email-masked]>
Date: Thu, 12 Mar 2026 15:16:29 -0500

Hi,

I just noticed $SUBJECT due to 5883ff30b0

[1/2] Compiling C object
contrib/pg_plan_advice/pg_plan_advice.so.p/pgpa_scan.c.o
In file included from ../src/include/postgres.h:49:0,
                 from ../contrib/pg_plan_advice/pgpa_scan.c:12:
../contrib/pg_plan_advice/pgpa_scan.c: In function ‘unique_nonjoin_rtekind’:
../src/include/utils/elog.h:241:18: warning: ‘rtekind’ may be used
uninitialized in this function [-Wmaybe-uninitialized]
  ereport(elevel, errmsg_internal(__VA_ARGS__))
                  ^~~~~~~~~~~~~~~
../contrib/pg_plan_advice/pgpa_scan.c:246:11: note: ‘rtekind’ was declared here
  RTEKind  rtekind;
           ^~~~~~~

Attached initializes rtekind to RTE_RELATION to keep the compiler happy.
The value is set correctly inside the loop before it's used.

--
Sami Imseih
Amazon Web Services (AWS)

---

From: Nathan Bossart <[email-masked]>
Date: Thu, 12 Mar 2026 16:20:14 -0500

I've added Robert.

> The value is set correctly inside the loop before it's used.

Looks correct to me.

-- 
nathan

---

From: Nathan Bossart <[email-masked]>
Date: Fri, 13 Mar 2026 11:32:48 -0500

>> The value is set correctly inside the loop before it's used.

Committed.

-- 
nathan

---

From: Robert Haas <[email-masked]>
Date: Fri, 10 Apr 2026 11:59:23 -0400

> >> The value is set correctly inside the loop before it's used.

Thanks. Apologies for failing to notice this thread.

-- 
Robert Haas
EDB: http://www.enterprisedb.com