Re: [HACKERS] RFC: ALTER SYSTEM [...] COMMENT - Mailing list pgsql-hackers

From Stephen Frost
Subject Re: [HACKERS] RFC: ALTER SYSTEM [...] COMMENT
Date
Msg-id 20170426171404.GB21223@tamriel.snowman.net
Whole thread Raw
In response to [HACKERS] RFC: ALTER SYSTEM [...] COMMENT  ("Joshua D. Drake" <jd@commandprompt.com>)
Responses Re: [HACKERS] RFC: ALTER SYSTEM [...] COMMENT  ("Joshua D. Drake" <jd@commandprompt.com>)
Re: [HACKERS] RFC: ALTER SYSTEM [...] COMMENT  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
JD,

* Joshua D. Drake (jd@commandprompt.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

pgsql-hackers by date:

Previous
From: Oleg Golovanov
Date:
Subject: [HACKERS] Re: [HACKERS] WIP: [[Parallel] Shared] Hash
Next
From: Peter Geoghegan
Date:
Subject: Re: [HACKERS] [PATCH] Incremental sort