From: Tom Lane <tgl@sss.pgh.pa.us>
To: Michael Herold <quabla@hemio.de>
Cc: pgsql-bugs@postgresql.org
Subject: Re: COMMENT ON INDEX silently fails
Date: Fri, 30 Sep 2016 08:49:01 -0400
Message-ID: <16508.1475239741@sss.pgh.pa.us> (raw)
In-Reply-To: <1475236787.15450.0@mail.hemio.de>
References: <1475236787.15450.0@mail.hemio.de>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
Michael Herold <quabla@hemio.de> 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, quabla@hemio.de
Subject: Re: COMMENT ON INDEX silently fails
In-Reply-To: <16508.1475239741@sss.pgh.pa.us>
References: <1475236787.15450.0@mail.hemio.de> <16508.1475239741@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox