public inbox for [email protected]  
help / color / mirror / Atom feed
From: Fujii Masao <[email protected]>
To: Etsuro Fujita <[email protected]>
Cc: Corey Huinker <[email protected]>
Cc: Robert Haas <[email protected]>
Cc: [email protected] <[email protected]>
Subject: Re: use of SPI by postgresImportForeignStatistics
Date: Fri, 10 Jul 2026 14:36:40 +0900
Message-ID: <CAHGQGwGjcQ4SwHMUQ9P8UYQ7iLKL1QE3uLSdONToQ1MrzpUUoQ@mail.gmail.com> (raw)
In-Reply-To: <CAPmGK16XqvvkWhsGgUASUQAtrxEtOfUud4id6do3zZ+XX44WZA@mail.gmail.com>
References: <CA+TgmoYqMtWb4zLUkT98oFnEkJ=Wz0Pw-ggDJrp9wnSXPzUaeQ@mail.gmail.com>
	<CAPmGK161TJ4G01eptv3sBqgxa4SNHDE9VRqoC6jy5Y6G3D8yDw@mail.gmail.com>
	<CA+TgmoZpwfTGqqp=0efV99e_BMYWdLFq2XKRWVSDcukifkZMeA@mail.gmail.com>
	<CADkLM=dxe8NbQu4RNi2OFXpaRKdpS0-CHGm6Mqtf_rW155BM4g@mail.gmail.com>
	<CADkLM=cV=uezAKyZdyyxnZOBRhGLUSbeYfDj5_jbDCLP9LP24Q@mail.gmail.com>
	<CA+TgmoaVcgZJpwxyi7HEfNMJhmm7BXkTQ468jvxkW2QzQZRkvg@mail.gmail.com>
	<CADkLM=dy18dDJ+j3-_Ofn11vt5J7zF33oTWnE6N=ePc83uS91A@mail.gmail.com>
	<CAPmGK15MfVT2H+PUvA_nAJvySGr_pAVkVx3KcnVXWGO36acWLA@mail.gmail.com>
	<CADkLM=dr5bfB8YN-bV1U0NDvyVO7a6uuz0BsAi89a1Md4A==8g@mail.gmail.com>
	<CAPmGK14P2GRe78hp6fZ3vExU_9RRDjMsYVOx7AALvUQ-hKTUiQ@mail.gmail.com>
	<CADkLM=cL9ZGvO-72QWyXA5Wqv-4P3T1fp+VFJy5e6k3Hf=POMw@mail.gmail.com>
	<CA+TgmoZdTVeXRQo__cEr_1y+mUO9nubOX=6PEfw7Cr0UfZQn6w@mail.gmail.com>
	<CADkLM=fe=ycPdwT2wE_iYwK8e8viMbWvwWhXR9vDe+55KKF-KQ@mail.gmail.com>
	<CADkLM=dWJaw04u9FU=WkykOy7bu7B5eKmoDkfVz6JXh7mdemkw@mail.gmail.com>
	<CA+TgmoY3a_S0munZ0wg4hQpMKVMyM_jpi6aGhFR0gAm1jLukag@mail.gmail.com>
	<CADkLM=cdKjgphHpFW8kKukHF+DVYKogHcqLXO=BA8MGfiRFqQA@mail.gmail.com>
	<CADkLM=c9BEuA9vPjE9Wco6+Lz-HSnnmBZrFhi=-yNi0K8tmZug@mail.gmail.com>
	<CAPmGK17W1sUB3JnkRoBpgO0_iSH5HRcc0_nxk8Us4KYsQhuQxg@mail.gmail.com>
	<CA+TgmoZd5MDhcx6uav6MWxhM42yWcfaRAHYKNtNkuog=yrKAgw@mail.gmail.com>
	<CADkLM=f_c7Xoq-bSzw28LgvxPa+OQ3rVow=xwkTyjz1J0=pMdw@mail.gmail.com>
	<CAPmGK14dY-Cex2rc08TinQjHR4Q1L6nqPBfdEBRZusP7n_TZSA@mail.gmail.com>
	<CADkLM=enKc-3-uTjUSXXhoRhSKDHVdb_ate+S2dtkEcscW5bvA@mail.gmail.com>
	<CAPmGK17rNA=dknxHCXbUoQ_xe2PQcPq0d-bhTr47wrUfXrDLFA@mail.gmail.com>
	<CADkLM=dYZ2XJ=nUMSYgA6D3VEFQ4rvpyDLKD-RrnfESUGxktiA@mail.gmail.com>
	<CAPmGK15eTnEtn_tPm+o0QA-jEnJUW+B2FPAF=vGNkFAGMApWNQ@mail.gmail.com>
	<CAPmGK16-=HvkijvSiDfo8=JmrHQ4ra79gSnJbKzW4Oob9yPfdQ@mail.gmail.com>
	<CAPmGK16XqvvkWhsGgUASUQAtrxEtOfUud4id6do3zZ+XX44WZA@mail.gmail.com>

On Fri, Jul 10, 2026 at 2:03 PM Etsuro Fujita <[email protected]> wrote:
>
> On Wed, Jul 8, 2026 at 9:04 PM Etsuro Fujita <[email protected]> wrote:
> > Attached is a new version
> > of the patch.  I'm planning to push and back-patch it, if no
> > objections.
>
> Committed and back-patched.

In the committed patch, I found that the set_*_arg() helper functions
in postgres_fdw.c are declared static in their prototypes, but their
definitions omit the static keyword. This looks like an oversight.

Attached patch adds static to the definitions for consistency and
to make their intended file-local scope explicit. It also fixes a few
nearby comment typos.

Regards,

-- 
Fujii Masao


Attachments:

  [application/octet-stream] v1-0001-postgres_fdw-Mark-statistics-import-helpers-as-st.patch (3.4K, ../CAHGQGwGjcQ4SwHMUQ9P8UYQ7iLKL1QE3uLSdONToQ1MrzpUUoQ@mail.gmail.com/2-v1-0001-postgres_fdw-Mark-statistics-import-helpers-as-st.patch)
  download | inline diff:
From f9793e5fe924b49e1cad93f7d33ed313283c51f7 Mon Sep 17 00:00:00 2001
From: Fujii Masao <[email protected]>
Date: Fri, 10 Jul 2026 14:22:54 +0900
Subject: [PATCH v1] postgres_fdw: Mark statistics import helpers as static

The set_*_arg helper functions in postgres_fdw.c are declared
static, but their definitions omitted the static keyword. Add it to
make their file-local scope explicit and keep the declarations and
definitions consistent.

Also fix a couple of nearby comment typos.
---
 contrib/postgres_fdw/postgres_fdw.c      | 12 ++++++------
 src/backend/statistics/attribute_stats.c |  2 +-
 src/backend/statistics/relation_stats.c  |  2 +-
 3 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/contrib/postgres_fdw/postgres_fdw.c b/contrib/postgres_fdw/postgres_fdw.c
index e6e0a4ab9b5..70de942de12 100644
--- a/contrib/postgres_fdw/postgres_fdw.c
+++ b/contrib/postgres_fdw/postgres_fdw.c
@@ -6134,7 +6134,7 @@ import_fetched_statistics(Relation relation,
 }
 
 /*
- * Conenience routine to fetch the value for the row/column of the PGresult
+ * Convenience routine to fetch the value for the row/column of the PGresult
  */
 static char *
 get_opt_value(PGresult *res, int row, int col)
@@ -6147,7 +6147,7 @@ get_opt_value(PGresult *res, int row, int col)
 /*
  * Convenience routine for setting optional text arguments
  */
-void
+static void
 set_text_arg(NullableDatum *arg, const char *s)
 {
 	if (s)
@@ -6165,7 +6165,7 @@ set_text_arg(NullableDatum *arg, const char *s)
 /*
  * Convenience routine for setting optional int32 arguments
  */
-void
+static void
 set_int32_arg(NullableDatum *arg, const char *s)
 {
 	if (s)
@@ -6185,7 +6185,7 @@ set_int32_arg(NullableDatum *arg, const char *s)
 /*
  * Convenience routine for setting optional uint32 arguments
  */
-void
+static void
 set_uint32_arg(NullableDatum *arg, const char *s)
 {
 	if (s)
@@ -6205,7 +6205,7 @@ set_uint32_arg(NullableDatum *arg, const char *s)
 /*
  * Convenience routine for setting optional float arguments
  */
-void
+static void
 set_float_arg(NullableDatum *arg, const char *s)
 {
 	if (s)
@@ -6225,7 +6225,7 @@ set_float_arg(NullableDatum *arg, const char *s)
 /*
  * Convenience routine for setting optional float[] arguments
  */
-void
+static void
 set_floatarr_arg(NullableDatum *arg, const char *s)
 {
 	if (s)
diff --git a/src/backend/statistics/attribute_stats.c b/src/backend/statistics/attribute_stats.c
index 2efb74b95a6..48e0df391e2 100644
--- a/src/backend/statistics/attribute_stats.c
+++ b/src/backend/statistics/attribute_stats.c
@@ -708,7 +708,7 @@ pg_restore_attribute_stats(PG_FUNCTION_ARGS)
 }
 
 /*
- * Import attribute statistics from NullableDatum inputs for all statitical
+ * Import attribute statistics from NullableDatum inputs for all statistical
  * values.
  *
  * For now, the 'version' argument is ignored. In the future it can be used
diff --git a/src/backend/statistics/relation_stats.c b/src/backend/statistics/relation_stats.c
index 990a7511d04..fbaab92284f 100644
--- a/src/backend/statistics/relation_stats.c
+++ b/src/backend/statistics/relation_stats.c
@@ -256,7 +256,7 @@ pg_restore_relation_stats(PG_FUNCTION_ARGS)
 }
 
 /*
- * Import relation statistics from NullableDatum inputs for all statitical
+ * Import relation statistics from NullableDatum inputs for all statistical
  * values.
  *
  * For now, the 'version' argument is ignored. In the future it can be used
-- 
2.55.0



view thread (30+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected]
  Subject: Re: use of SPI by postgresImportForeignStatistics
  In-Reply-To: <CAHGQGwGjcQ4SwHMUQ9P8UYQ7iLKL1QE3uLSdONToQ1MrzpUUoQ@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox