Fix function name in error hint
authorMagnus Hagander
Thu, 18 Mar 2021 10:23:48 +0000 (11:23 +0100)
committerMagnus Hagander
Thu, 18 Mar 2021 10:23:48 +0000 (11:23 +0100)
pg_read_file() is the function that's in core, pg_file_read() is in
adminpack. But when using pg_file_read() in adminpack it calls the *C*
level function pg_read_file() in core, which probably threw the original
author off. But the error hint should be about the SQL function.

Reported-By: Sergei Kornilov
Backpatch-through: 11
Discussion: https://postgr.es/m/373021616060475@mail.yandex.ru

src/backend/utils/adt/genfile.c

index 5eee853707c8f26d26395dcb6e06201117702b1b..d0847a4435db34fe91f2d89a2cd16f7c55060c2e 100644 (file)
@@ -250,7 +250,7 @@ pg_read_file(PG_FUNCTION_ARGS)
                 (errmsg("must be superuser to read files with adminpack 1.0"),
        /* translator: %s is a SQL function name */
                  errhint("Consider using %s, which is part of core, instead.",
-                         "pg_file_read()"))));
+                         "pg_read_file()"))));
 
    /* handle optional arguments */
    if (PG_NARGS() >= 3)