Re: Column COMMENTs in CREATE TABLE? - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: Column COMMENTs in CREATE TABLE?
Date
Msg-id 9035775f-42a2-f800-5f9e-25f36cb13f00@2ndquadrant.com
Whole thread Raw
In response to Re: Column COMMENTs in CREATE TABLE?  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Column COMMENTs in CREATE TABLE?  (David Fetter <david@fetter.org>)
List 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



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: regression test for extended query protocol
Next
From: Tom Lane
Date:
Subject: Re: Bogus ANALYZE results for an otherwise-unique column with many nulls