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

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

On 04/26/2017 10:14 AM, Stephen Frost wrote:
> JD,

> 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');

Dig it, although we probably want the equivalent of:

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

Or something like that.

>
> 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.

Agreed and I think that using existing COMMENT ON capability is likely
to get this pushed farther down the road.

I wouldn't fight hard to change it but really if we think about it, what
makes more sense from usability perspective?

CREATE TABLE foo() COMMENT IS

or

CREATE TABLE foo;
COMMENT ON TABLE foo IS

Thanks,

JD

--
Command Prompt, Inc. http://the.postgres.company/
+1-503-667-4564
PostgreSQL Centered full stack support, consulting and development.
Everyone appreciates your honesty, until you are honest with them.
Unless otherwise stated, opinions are my own.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2017-04-26 17:25:39 Re: StandbyRecoverPreparedTransactions recovers subtrans links incorrectly
Previous Message Thom Brown 2017-04-26 17:22:35 Re: RFC: ALTER SYSTEM [...] COMMENT