aboutsummaryrefslogtreecommitdiff
path: root/src/bin/psql/command.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2017-03-09 22:42:16 -0500
committerTom Lane <tgl@sss.pgh.pa.us>2017-03-09 22:42:16 -0500
commitfcd778eb703c154c0fbba249e17c21b7ae4de19b (patch)
tree2e303735853b29f698314409403a0ae795e90f1a /src/bin/psql/command.c
parent15bb93e28e49fdf4f28d509c07d1527886acb3e2 (diff)
downloadpostgresql-fcd778eb703c154c0fbba249e17c21b7ae4de19b.tar.gz
postgresql-fcd778eb703c154c0fbba249e17c21b7ae4de19b.zip
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/11145.1488931324@sss.pgh.pa.us
Diffstat (limited to 'src/bin/psql/command.c')
-rw-r--r--src/bin/psql/command.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/bin/psql/command.c b/src/bin/psql/command.c
index 07efc27a697..4f4a0aa9bd4 100644
--- a/src/bin/psql/command.c
+++ b/src/bin/psql/command.c
@@ -27,6 +27,7 @@
#include <sys/stat.h> /* for stat() */
#endif
+#include "catalog/pg_class.h"
#include "portability/instr_time.h"
#include "libpq-fe.h"
@@ -3465,11 +3466,11 @@ get_create_object_cmd(EditableObjectType obj_type, Oid oid,
switch (relkind[0])
{
#ifdef NOT_USED
- case 'm':
+ case RELKIND_MATVIEW:
appendPQExpBufferStr(buf, "CREATE OR REPLACE MATERIALIZED VIEW ");
break;
#endif
- case 'v':
+ case RELKIND_VIEW:
appendPQExpBufferStr(buf, "CREATE OR REPLACE VIEW ");
break;
default: