Re: Useless "Replica Identity: NOTHING" noise from psql \d

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: Andres Freund <andres(at)2ndquadrant(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Useless "Replica Identity: NOTHING" noise from psql \d
Date: 2014-03-26 16:10:56
Message-ID: 20140326161056.GA468@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Mar 26, 2014 at 12:53:32PM -0300, Alvaro Herrera wrote:
> Bruce Momjian wrote:
> > On Wed, Mar 26, 2014 at 12:20:07PM -0300, Alvaro Herrera wrote:
>
> > > Not opposed to this, but it seems a bit strange; REPLICA IDENTITY is a
> > > property of the table, not of any individual index. I think we should
> > > lose the token in the "Indexes" section.
> >
> > That is an interesting idea. It would mean that \d table would not show
> > anything about replica identity, because right now it does:
> >
> > test=> \d test
> > Table "public.test"
> > Column | Type | Modifiers
> > --------+---------+-----------
> > x | integer | not null
> > Indexes:
> > "test_pkey" PRIMARY KEY, btree (x) REPLICA IDENTITY
> >
> > That seems logical.
>
> Hmm. It seems to me that to make this more compact we could keep the
> current token in the index line if it's INDEX, and not display the
> Replica Identity: line at all; and if it's something other than index
> and different from the default value, then print "Replica Identity" in
> both \d and \d+.

OK. Tom's original complaint was about showing the default state in \d:

http://www.postgresql.org/message-id/12303.1387038473@sss.pgh.pa.us

though that example was for an odd case where a system table didn't use
the default value.

The attached patch matches your suggestion. It is basically back to
what the code originally had, except it skips system tables, and shows
"???" for invalid values.

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ Everyone has their own god. +

Attachment Content-Type Size
repica.diff text/x-diff 1.3 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2014-03-26 16:29:04 Re: Only first XLogRecData is visible to rm_desc with WAL_DEBUG
Previous Message Alvaro Herrera 2014-03-26 15:53:32 Re: Useless "Replica Identity: NOTHING" noise from psql \d