Re: silence compiler warning in brin.c

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Zhihong Yu <zyu@yugabyte.com>
Cc: Nathan Bossart <nathandbossart@gmail.com>, PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2022-06-01T17:55:52Z
Lists: pgsql-hackers
Zhihong Yu <zyu@yugabyte.com> writes:
> Hi,

>     if (heapRel == NULL || heapoid != IndexGetRelation(indexoid, false))
>         ereport(ERROR,

> I wonder why the above check is not placed in the else block:

>     else
>         heapRel = NULL;

Because we don't want to throw that error until we've exhausted the
possibilities for throwing other errors.

			regards, tom lane



Commits

  1. Silence compiler warnings from some older compilers.