Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bpxGA-0007bD-0q for pgsql-bugs@arkaria.postgresql.org; Fri, 30 Sep 2016 12:49:50 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bpxG9-0001DE-Ag for pgsql-bugs@arkaria.postgresql.org; Fri, 30 Sep 2016 12:49:49 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bpxFV-0000Uw-4O for pgsql-bugs@postgresql.org; Fri, 30 Sep 2016 12:49:09 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bpxFR-0001W3-OP for pgsql-bugs@postgresql.org; Fri, 30 Sep 2016 12:49:08 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id u8UCn1Pb016509; Fri, 30 Sep 2016 08:49:01 -0400 From: Tom Lane To: Michael Herold cc: pgsql-bugs@postgresql.org Subject: Re: COMMENT ON INDEX silently fails In-reply-to: <1475236787.15450.0@mail.hemio.de> References: <1475236787.15450.0@mail.hemio.de> Comments: In-reply-to Michael Herold message dated "Fri, 30 Sep 2016 13:59:47 +0200" Date: Fri, 30 Sep 2016 08:49:01 -0400 Message-ID: <16508.1475239741@sss.pgh.pa.us> X-Pg-Spam-Score: -4.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 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) regards, tom lane -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs