Re: Column COMMENTs in CREATE TABLE?

From: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, David Fetter <david(at)fetter(dot)org>
Cc: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, Marko Tiikkaja <marko(at)joh(dot)to>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Column COMMENTs in CREATE TABLE?
Date: 2016-08-05 14:14:21
Message-ID: 9035775f-42a2-f800-5f9e-25f36cb13f00@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 7/3/16 11:41 AM, Tom Lane wrote:
> I can see the reasoning for
> allowing COMMENT in a table column definition, but the argument for
> allowing it in simpler CREATEs seems tissue-thin:
>
> CREATE FUNCTION foo(int) RETURNS ... ;
> COMMENT ON FUNCTION foo(int) IS 'blah';
>
> vs
>
> CREATE FUNCTION foo(int) RETURNS ...
> WITH (COMMENT 'blah');
>
> Not much of a keystroke savings, nor is the comment noticeably
> "closer" to its object than before.

I had actually been thinking about a similar proposal, but specifically
for CREATE FUNCTION. But the syntax would have to put it above the
function body, not below it. I think the CREATE FUNCTION syntax could
actually handle that.

--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2016-08-05 14:27:41 Re: Bogus ANALYZE results for an otherwise-unique column with many nulls
Previous Message Tom Lane 2016-08-05 14:11:28 Re: regression test for extended query protocol