Re: Column COMMENTs in CREATE TABLE?

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Marko Tiikkaja <marko(at)joh(dot)to>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Column COMMENTs in CREATE TABLE?
Date: 2016-07-02 17:06:49
Message-ID: CAKFQuwZmn1X1ix==hKDJByEYP4MNZbsBMhOcW59JZ3LwZkZ32w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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

David J.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Vladimir Sitnikov 2016-07-02 17:28:07 Re: Statistics Injection
Previous Message Marko Tiikkaja 2016-07-02 16:55:06 Column COMMENTs in CREATE TABLE?