Re: RFC: ALTER SYSTEM [...] COMMENT

From: Stephen Frost <sfrost(at)snowman(dot)net>
To: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: RFC: ALTER SYSTEM [...] COMMENT
Date: 2017-04-26 17:14:04
Message-ID: 20170426171404.GB21223@tamriel.snowman.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

JD,

* Joshua D. Drake (jd(at)commandprompt(dot)com) wrote:
> Does not use existing comment functionality. Alternate solution
> which would decrease functionality is:
>
> COMMENT ON SETTING setting IS 'comment';

That seems like a pretty reasonable idea, at least from where I sit.

> Looking forward, we may want to do the following:
>
> 1. Make it so any object can have a comment with creation, e.g;
>
> CREATE TABLE table () COMMENT IS '';

I'm pretty sure this has been discussed previously.

> 2. Make it so comments are appended not replaced.

Having COMMENT ON accept a general query whose result is then cast to
text and stored as the comment would allow this to be done, eg:

COMMENT ON table IS (pg_get_comment('table') || ' new text');

We could also have new syntax along these lines, for this specific case:

COMMENT ON table ADD ' new text';

Though we have this pretty powerful language, seems a bit of a shame to
invent something new for working with comments.

Thanks!

Stephen

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Geoghegan 2017-04-26 17:20:29 Re: [PATCH] Incremental sort
Previous Message Oleg Golovanov 2017-04-26 17:13:48 Re: [HACKERS] WIP: [[Parallel] Shared] Hash