Re: Column COMMENTs in CREATE TABLE?

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: Column COMMENTs in CREATE TABLE?
Дата
Msg-id CAKFQuwZmn1X1ix==hKDJByEYP4MNZbsBMhOcW59JZ3LwZkZ32w@mail.gmail.com
обсуждение исходный текст
Ответ на Column COMMENTs in CREATE TABLE?  (Marko Tiikkaja <marko@joh.to>)
Ответы Re: Column COMMENTs in CREATE TABLE?  (Fabrízio de Royes Mello <fabriziomello@gmail.com>)
Re: Column COMMENTs in CREATE TABLE?  (David Fetter <david@fetter.org>)
Список pgsql-hackers
On Sat, Jul 2, 2016 at 12:55 PM, Marko Tiikkaja <marko@joh.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.

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Marko Tiikkaja
Дата:
Сообщение: Column COMMENTs in CREATE TABLE?
Следующее
От: Vladimir Sitnikov
Дата:
Сообщение: Re: Statistics Injection