Fixup for pg_set_relation_stats().

Reported-by: Noriyoshi Shinoda
Discussion: https://postgr.es/m/DM4PR84MB17345E2DFF28A5557B7CBC3CEE7A2@DM4PR84MB1734.NAMPRD84.PROD.OUTLOOK.COM
This commit is contained in:
Jeff Davis 2024-10-13 13:44:23 -07:00
parent c0b74323dc
commit 35a015a600

View 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;
}