pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Yugo Nagata <nagata@sraoss.co.jp>
To: pgsql-hackers@postgresql.org
Subject: Unused argument from execute_sql_string()
Date: Fri, 7 Sep 2018 18:05:04 +0900
Message-ID: <20180907180504.1ff19e1675bb44a67e9c7ab1@sraoss.co.jp> (raw)

Hi,

I found that a argument "filename" is not used in execute_sql_string() 
although the comment says "filename is used only to report errors.",
so I think we can remove this argument as done in the patch I attached.

Regards,
-- 
Yugo Nagata <nagata@sraoss.co.jp>

Attachments:

  [text/x-diff] execute_sql_string.patch (1.1K, ../20180907180504.1ff19e1675bb44a67e9c7ab1@sraoss.co.jp/2-execute_sql_string.patch)
  download | inline diff:
diff --git a/src/backend/commands/extension.c b/src/backend/commands/extension.c
index 2e4538146d..2d761a5773 100644
--- a/src/backend/commands/extension.c
+++ b/src/backend/commands/extension.c
@@ -683,8 +683,6 @@ read_extension_script_file(const ExtensionControlFile *control,
 /*
  * Execute given SQL string.
  *
- * filename is used only to report errors.
- *
  * Note: it's tempting to just use SPI to execute the string, but that does
  * not work very well.  The really serious problem is that SPI will parse,
  * analyze, and plan the whole string before executing any of it; of course
@@ -694,7 +692,7 @@ read_extension_script_file(const ExtensionControlFile *control,
  * could be very long.
  */
 static void
-execute_sql_string(const char *sql, const char *filename)
+execute_sql_string(const char *sql)
 {
 	List	   *raw_parsetree_list;
 	DestReceiver *dest;
@@ -921,7 +919,7 @@ execute_extension_script(Oid extensionOid, ExtensionControlFile *control,
 		/* And now back to C string */
 		c_sql = text_to_cstring(DatumGetTextPP(t_sql));
 
-		execute_sql_string(c_sql, filename);
+		execute_sql_string(c_sql);
 	}
 	PG_CATCH();
 	{

view thread (4+ messages)  latest in thread

Message-ID: <20180907180504.1ff19e1675bb44a67e9c7ab1@sraoss.co.jp>
Permalink:  ../20180907180504.1ff19e1675bb44a67e9c7ab1@sraoss.co.jp/
Also on:    postgresql.org/message-id/20180907180504.1ff19e1675bb44a67e9c7ab1@sraoss.co.jp

 ·  · 

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: pgsql-hackers@postgresql.org
  Cc: nagata@sraoss.co.jp
  Subject: Re: Unused argument from execute_sql_string()
  In-Reply-To: <20180907180504.1ff19e1675bb44a67e9c7ab1@sraoss.co.jp>

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

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