Thread: pgsql: pg_amcheck: Use CppAsString2() for relkind and relpersistence in

pgsql: pg_amcheck: Use CppAsString2() for relkind and relpersistence in

From
Michael Paquier
Date:
pg_amcheck: Use CppAsString2() for relkind and relpersistence in queries

This utility has been using hardcoded values for relkind and
relpersistence in its queries generated.  These queries are switched to
use CppAsString2() instead, with the values fetched directly from the
header of pg_class.  This has the advantage of making the code more
self-documented, as it becomes unnecessary to look at a header for the
meaning of a value.

There should be no functional changes; the queries are generated the
same way as before this commit.

Reviewed-by: Nathan Bossart, Daniel Gustafsson, Álvaro Herrera, Karina
Litskevich
Discussion: https://postgr.es/m/ZxIvemDk0Ob1RGwh@paquier.xyz

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/91f5a4a000ea4979e5490e0a111c24f4486d7361

Modified Files
--------------
src/bin/pg_amcheck/pg_amcheck.c | 42 ++++++++++++++++++++++++++++-------------
1 file changed, 29 insertions(+), 13 deletions(-)