diff options
author | Tom Lane | 2017-03-10 03:42:16 +0000 |
---|---|---|
committer | Tom Lane | 2017-03-10 03:42:16 +0000 |
commit | fcd778eb703c154c0fbba249e17c21b7ae4de19b (patch) | |
tree | 2e303735853b29f698314409403a0ae795e90f1a /src/bin/pg_upgrade/version.c | |
parent | 15bb93e28e49fdf4f28d509c07d1527886acb3e2 (diff) |
Fix hard-coded relkind constants in assorted src/bin files.
Although it's reasonable to expect that most of these constants will
never change, that does not make it good programming style to hard-code
the value rather than using the RELKIND_FOO macros.
Discussion: https://postgr.es/m/[email protected]
Diffstat (limited to 'src/bin/pg_upgrade/version.c')
-rw-r--r-- | src/bin/pg_upgrade/version.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/bin/pg_upgrade/version.c b/src/bin/pg_upgrade/version.c index aa462daed3d..a3651aadede 100644 --- a/src/bin/pg_upgrade/version.c +++ b/src/bin/pg_upgrade/version.c @@ -10,6 +10,8 @@ #include "postgres_fe.h" #include "pg_upgrade.h" + +#include "catalog/pg_class.h" #include "fe_utils/string_utils.h" @@ -234,7 +236,10 @@ old_9_6_check_for_unknown_data_type_usage(ClusterInfo *cluster) "WHERE c.oid = a.attrelid AND " " NOT a.attisdropped AND " " a.atttypid = 'pg_catalog.unknown'::pg_catalog.regtype AND " - " c.relkind IN ('r', 'c', 'm') AND " + " c.relkind IN (" + CppAsString2(RELKIND_RELATION) ", " + CppAsString2(RELKIND_COMPOSITE_TYPE) ", " + CppAsString2(RELKIND_MATVIEW) ") AND " " c.relnamespace = n.oid AND " /* exclude possible orphaned temp tables */ " n.nspname !~ '^pg_temp_' AND " |