Re: Column COMMENTs in CREATE TABLE?

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Fabrízio Mello <fabriziomello(at)gmail(dot)com>
Cc: Marko Tiikkaja <marko(at)joh(dot)to>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Column COMMENTs in CREATE TABLE?
Date: 2016-07-03 03:34:43
Message-ID: CAKFQuwa0LED7S=OarPOAkNcysyYosXebkyQDTTX4LHcK36SAUQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, Jul 2, 2016 at 8:31 PM, Fabrízio de Royes Mello <
fabriziomello(at)gmail(dot)com> wrote:

>
>
> Em sábado, 2 de julho de 2016, David G. Johnston <
> david(dot)g(dot)johnston(at)gmail(dot)com> escreveu:
>
>> On Sat, Jul 2, 2016 at 12:55 PM, Marko Tiikkaja <marko(at)joh(dot)to> wrote:
>>
>>>
>>> What I would prefer is something like this:
>>>
>>> CREATE TABLE foo(
>>> f1 int NOT NULL COMMENT
>>> 'the first field',
>>> f2 int NOT NULL COMMENT
>>> 'the second field',
>>> ...
>>> );
>>>
>>> which would ensure the comments are both next to the field definition
>>> they're documenting and that they make it all the way to the database. I
>>> looked into the biggest products, and MySQL supports this syntax. I
>>> couldn't find any similar syntax in any other product.
>>>
>>>
>> ​+1 for the idea - though restricting it to columns would not be ideal.
>>
>>
>> CREATE TABLE name
>> COMMENT IS
>> 'Table Comment Here'
>> (
>> col1 serial COMMENT IS 'Place comment here'
>> )​;
>>
>>
> And what about the other CREATE statements? IMHO if we follow this path
> then we should add COMMENT to all CREATE statements and perhaps also to
> ALTER. Of course in a set of small patches to make the reviewers life
> easier.
>
>
​I should have made it clear I didn't expect TABLE to be the only object
but rather was using it as an example of how we could/should do this
generally for top-level objects (e.g., table) and sub-objects (e.g.,
column)​.

David J.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Geoghegan 2016-07-03 03:47:20 Re: Bug in batch tuplesort memory CLUSTER case (9.6 only)
Previous Message David Steele 2016-07-03 03:06:42 Re: Password identifiers, protocol aging and SCRAM protocol