pg_amcheck: Use CppAsString2() for relkind and relpersistence in queries
authorMichael Paquier <[email protected]>
Tue, 26 Nov 2024 00:45:34 +0000 (09:45 +0900)
committerMichael Paquier <[email protected]>
Tue, 26 Nov 2024 00:45:34 +0000 (09:45 +0900)
commit91f5a4a000ea4979e5490e0a111c24f4486d7361
tree004f89ae72bfc829bbc02fd223122f5fa740000b
parentcc4c90cef918fc0cbd13af8b51838c5de5da73bb
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/[email protected]
src/bin/pg_amcheck/pg_amcheck.c