Fixup for pg_set_relation_stats().
authorJeff Davis <[email protected]>
Sun, 13 Oct 2024 20:44:23 +0000 (13:44 -0700)
committerJeff Davis <[email protected]>
Sun, 13 Oct 2024 20:44:23 +0000 (13:44 -0700)
Reported-by: Noriyoshi Shinoda
Discussion: https://postgr.es/m/DM4PR84MB17345E2DFF28A5557B7CBC3CEE7A2@DM4PR84MB1734.NAMPRD84.PROD.OUTLOOK.COM

src/backend/statistics/relation_stats.c

index ffa3d83a8781dfcdcb42a85cb2aaab59d57727cb..26f15061e895ed5cf67918fd83b41ca82c439d24 100644 (file)
@@ -99,11 +99,11 @@ relation_statistics_update(FunctionCallInfo fcinfo, int elevel)
        {
                int32           relpages = PG_GETARG_INT32(RELPAGES_ARG);
 
-               if (relpages < -1)
+               if (relpages < 0)
                {
                        ereport(elevel,
                                        (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-                                        errmsg("relpages cannot be < -1")));
+                                        errmsg("relpages cannot be < 0")));
                        table_close(crel, RowExclusiveLock);
                        return false;
                }