]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
Fix function name in error hint
authorMagnus Hagander <magnus@hagander.net>
Thu, 18 Mar 2021 10:24:42 +0000 (11:24 +0100)
committerMagnus Hagander <magnus@hagander.net>
Thu, 18 Mar 2021 10:24:42 +0000 (11:24 +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 eaf4bcdcdcc2f73f1a1b285288312a20cd951230..5a8c815b4630ef8b84cf64625937020749d82fb8 100644 (file)
@@ -246,7 +246,7 @@ pg_read_file(PG_FUNCTION_ARGS)
                ereport(ERROR,
                                (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
                                 (errmsg("must be superuser to read files with adminpack 1.0"),
-                                 errhint("Consider using pg_file_read(), which is part of core, instead."))));
+                                 errhint("Consider using pg_read_file(), which is part of core, instead."))));
 
        /* handle optional arguments */
        if (PG_NARGS() >= 3)