Simplify static function in extension.c
authorMichael Paquier <michael@paquier.xyz>
Thu, 13 Sep 2018 07:56:57 +0000 (16:56 +0900)
committerMichael Paquier <michael@paquier.xyz>
Thu, 13 Sep 2018 07:56:57 +0000 (16:56 +0900)
An extra argument for the filename defining the extension script
location was present, aimed at being used for error reporting, but has
never been used.  This was around since extensions have been added in
d9572c4.

Author: Yugo Nagata
Reviewed-by: Tatsuo Ishii
Discussion: https://postgr.es/m/20180907180504.1ff19e1675bb44a67e9c7ab1@sraoss.co.jp

src/backend/commands/extension.c

index 2e4538146d2930e8867b5716e1e8239b547bcad4..2d761a5773f3217202942d013e4ce8d7c4d97eff 100644 (file)
@@ -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();
    {