summaryrefslogtreecommitdiff
path: root/src/bin/psql
diff options
context:
space:
mode:
authorBruce Momjian2014-04-15 17:28:54 +0000
committerBruce Momjian2014-04-15 17:28:54 +0000
commit4168c00a5d9c0c0c17cdfc902587b6d22ea1720f (patch)
tree35a2de6d3fb312ed3d04f53cba4f2df9107f8121 /src/bin/psql
parentc92c3d50d7fbe7391b5fc864b444346b2db29ffe (diff)
psql: conditionally display oids and replication identity
In psql \d+, display oids only when they exist, and display replication identity only when it is non-default. Also document the defaults for replication identity for system and non-system tables. Update regression output.
Diffstat (limited to 'src/bin/psql')
-rw-r--r--src/bin/psql/describe.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c
index d1447fe723e..ffdeda8d57d 100644
--- a/src/bin/psql/describe.c
+++ b/src/bin/psql/describe.c
@@ -2345,13 +2345,14 @@ describeOneTableDetails(const char *schemaname,
printTableAddFooter(&cont, buf.data);
}
- if ((tableinfo.relkind == 'r' || tableinfo.relkind == 'm') &&
+ if (verbose && (tableinfo.relkind == 'r' || tableinfo.relkind == 'm') &&
/*
* No need to display default values; we already display a
* REPLICA IDENTITY marker on indexes.
*/
- tableinfo.relreplident != 'd' && tableinfo.relreplident != 'i' &&
- strcmp(schemaname, "pg_catalog") != 0)
+ tableinfo.relreplident != 'i' &&
+ ((strcmp(schemaname, "pg_catalog") != 0 && tableinfo.relreplident != 'd') ||
+ (strcmp(schemaname, "pg_catalog") == 0 && tableinfo.relreplident != 'n')))
{
const char *s = _("Replica Identity");
@@ -2365,14 +2366,8 @@ describeOneTableDetails(const char *schemaname,
}
/* OIDs, if verbose and not a materialized view */
- if (verbose && tableinfo.relkind != 'm')
- {
- const char *s = _("Has OIDs");
-
- printfPQExpBuffer(&buf, "%s: %s", s,
- (tableinfo.hasoids ? _("yes") : _("no")));
- printTableAddFooter(&cont, buf.data);
- }
+ if (verbose && tableinfo.relkind != 'm' && tableinfo.hasoids)
+ printTableAddFooter(&cont, _("Has OIDs: yes"));
/* Tablespace info */
add_tablespace_footer(&cont, tableinfo.relkind, tableinfo.tablespace,