On Tue, Dec 17, 2013 at 09:37:09AM -0500, Robert Haas wrote:
> > Patch attached.
> 
> I vote for showing it only with +, but regardless of whether the value
> matches the expected default.  I'd keep the relkind test, though,
> because I think I noticed that it currently shows up for indexes,
> which is dumb.

Is this the patch you had in mind?  I kept the pg_catalog filter.  Do we
want to always show the replica identity line for \d+?

        test=> \d+ test
                                 Table "public.test"
         Column |  Type   | Modifiers | Storage | Stats target | Description
        --------+---------+-----------+---------+--------------+-------------
         x      | integer |           | plain   |              |
        Replica Identity: full
        Has OIDs: no

I used lower-case for the value, rather than all-caps.

-- 
  Bruce Momjian  <br...@momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + Everyone has their own god. +
diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c
new file mode 100644
index a194ce7..a75fc82
*** a/src/bin/psql/describe.c
--- b/src/bin/psql/describe.c
*************** describeOneTableDetails(const char *sche
*** 2345,2358 ****
  			printTableAddFooter(&cont, buf.data);
  		}
  
! 		if ((tableinfo.relkind == 'r' || tableinfo.relkind == 'm') &&
! 			tableinfo.relreplident != 'd' && tableinfo.relreplident != 'i')
  		{
  			const char *s = _("Replica Identity");
  
  			printfPQExpBuffer(&buf, "%s: %s",
  							  s,
! 							  tableinfo.relreplident == 'n' ? "NOTHING" : "FULL");
  			printTableAddFooter(&cont, buf.data);
  		}
  
--- 2345,2358 ----
  			printTableAddFooter(&cont, buf.data);
  		}
  
! 		if (verbose && (tableinfo.relkind == 'r' || tableinfo.relkind == 'm') &&
! 			strcmp(schemaname, "pg_catalog") != 0)
  		{
  			const char *s = _("Replica Identity");
  
  			printfPQExpBuffer(&buf, "%s: %s",
  							  s,
! 							  tableinfo.relreplident == 'n' ? "nothing" : "full");
  			printTableAddFooter(&cont, buf.data);
  		}
  
-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to