Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bq39D-0006oh-SG for pgsql-bugs@arkaria.postgresql.org; Fri, 30 Sep 2016 19:07:03 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bq39C-0004Qx-Dm for pgsql-bugs@arkaria.postgresql.org; Fri, 30 Sep 2016 19:07:02 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bq39B-0004OQ-Cf for pgsql-bugs@postgresql.org; Fri, 30 Sep 2016 19:07:01 +0000 Received: from 173-164-140-181-sfba.hfc.comcastbusiness.net ([173.164.140.181] helo=fetter.org) by makus.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bq393-0002f8-Tw for pgsql-bugs@postgresql.org; Fri, 30 Sep 2016 19:07:00 +0000 Received: by fetter.org (Postfix, from userid 1000) id 3ED97E05ED; Fri, 30 Sep 2016 12:06:52 -0700 (PDT) Date: Fri, 30 Sep 2016 12:06:52 -0700 From: David Fetter To: Tom Lane Cc: Michael Herold , pgsql-bugs@postgresql.org Subject: Re: COMMENT ON INDEX silently fails Message-ID: <20160930190652.GA9774@fetter.org> References: <1475236787.15450.0@mail.hemio.de> <16508.1475239741@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <16508.1475239741@sss.pgh.pa.us> User-Agent: Mutt/1.7.0 (2016-08-17) X-Pg-Spam-Score: -0.9 (/) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org On Fri, Sep 30, 2016 at 08:49:01AM -0400, Tom Lane wrote: > Michael Herold writes: > > The statement > > COMMENT ON INDEX object_name IS '...' > > does not fail if object_name is a table constraint. However, it does > > not seem to have any effect. > > Sure it does. > > regression=# create table foo (f1 int primary key); > CREATE TABLE > regression=# \d foo > Table "public.foo" > Column | Type | Modifiers > --------+---------+----------- > f1 | integer | not null > Indexes: > "foo_pkey" PRIMARY KEY, btree (f1) > > regression=# select * from pg_description where objoid = 'foo_pkey'::regclass; > objoid | classoid | objsubid | description > --------+----------+----------+------------- > (0 rows) > > regression=# comment on index foo_pkey is 'test comment'; > COMMENT > regression=# select * from pg_description where objoid = 'foo_pkey'::regclass; > objoid | classoid | objsubid | description > --------+----------+----------+-------------- > 478892 | 1259 | 0 | test comment > (1 row) > > I suspect you were expecting the comment to be displayed in some place it > isn't, but that's hard to discuss intelligently when you didn't say where > you expected it to show up. It is there in, eg, \di+ output: > > regression=# \di+ foo_pkey > List of relations > Schema | Name | Type | Owner | Table | Size | Description > --------+----------+-------+----------+-------+------------+-------------- > public | foo_pkey | index | postgres | foo | 8192 bytes | test comment > (1 row) It's not in the \df+ output, where a reasonable person could expect it to show up. Is this worth a patch for 10? Best, David. -- David Fetter http://fetter.org/ Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter Skype: davidfetter XMPP: david(dot)fetter(at)gmail(dot)com Remember to vote! Consider donating to Postgres: http://www.postgresql.org/about/donate -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs