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

2017-05-01 Thread Amit Kapila
On Wed, Apr 26, 2017 at 10:33 PM, Joshua D. Drake wrote: > I propose: > > Add a column to pg_settings comment(text) > Change the grammar to allow: > > ALTER SYSTEM SET configuration_parameter { TO | = } { value | 'value' | > DEFAULT } COMMENT 'comment' > > Example: > >

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

2017-04-26 Thread Tom Lane
Stephen Frost writes: > * Tom Lane (t...@sss.pgh.pa.us) wrote: >> It'd be better to invent inverse pg_get_comment and pg_set_comment >> functions, then you could do bulk-update things like >> select pg_set_comment('table', pg_get_comment('table') || ' more') >> from pg_class

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

2017-04-26 Thread Stephen Frost
* Tom Lane (t...@sss.pgh.pa.us) wrote: > Stephen Frost writes: > > 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'); >

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

2017-04-26 Thread Joshua D. Drake
On 04/26/2017 10:31 AM, Tom Lane wrote: "Joshua D. Drake" writes: 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 I think it's likely to be impossible to shoehorn

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

2017-04-26 Thread Tom Lane
Stephen Frost writes: > 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'); Putting general subexpressions into utility

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

2017-04-26 Thread Hunley, Douglas
On Wed, Apr 26, 2017 at 1:03 PM, Joshua D. Drake wrote: > Problem we are trying to solve: > > Having documentation for changes to GUC parameters that are modified via > ALTER SYSTEM. > > Why? > > Because documentation is good and required for a proper production system. >

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

2017-04-26 Thread Tom Lane
"Joshua D. Drake" writes: > 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 I think it's likely to be impossible to shoehorn such a thing into every type of CREATE

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

2017-04-26 Thread Joshua D. Drake
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

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

2017-04-26 Thread Thom Brown
On 26 April 2017 at 18:03, Joshua D. Drake wrote: > -hackers, > > We have had ALTER SYSTEM for some time now. It is awesome to be able to make > changes that can be system wide without ever having to hit a shell but it > does lack a feature that seems like an oversight,

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

2017-04-26 Thread Stephen Frost
JD, * Joshua D. Drake (j...@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,

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

2017-04-26 Thread Joshua D. Drake
-hackers, We have had ALTER SYSTEM for some time now. It is awesome to be able to make changes that can be system wide without ever having to hit a shell but it does lack a feature that seems like an oversight, the ability to comment. Problem we are trying to solve: Having documentation