Re: [HACKERS] Column COMMENTs in CREATE TABLE?

2016-08-05 Thread Peter Eisentraut
On 8/5/16 11:58 AM, David Fetter wrote: > For what it's worth, I tend to put the function body last. That's > just my taste, though. Would it be hard to keep the ability to > permute the stuff after > > CREATE FUNCTION (args) > RETURNS [SETOF] type > > as we have it now? I don't think

Re: [HACKERS] Column COMMENTs in CREATE TABLE?

2016-08-05 Thread David Fetter
On Fri, Aug 05, 2016 at 10:14:21AM -0400, Peter Eisentraut wrote: > 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)

Re: [HACKERS] Column COMMENTs in CREATE TABLE?

2016-08-05 Thread Peter Eisentraut
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 > >

Re: [HACKERS] Column COMMENTs in CREATE TABLE?

2016-07-03 Thread Tom Lane
David Fetter writes: > On Sat, Jul 02, 2016 at 01:06:49PM -0400, David G. Johnston wrote: >> ​+1 for the idea - though restricting it to columns would not be ideal. > +1 for adding it to all the CREATEs whose objects support COMMENT. TBH, I think this is a pretty bad idea. I can see the reaso

Re: [HACKERS] Column COMMENTs in CREATE TABLE?

2016-07-02 Thread David G. Johnston
On Sat, Jul 2, 2016 at 8:31 PM, Fabrízio de Royes Mello < fabriziome...@gmail.com> wrote: > > > Em sábado, 2 de julho de 2016, David G. Johnston < > david.g.johns...@gmail.com> escreveu: > >> On Sat, Jul 2, 2016 at 12:55 PM, Marko Tiikkaja wrote: >> >>> >>> What I would prefer is something like t

Re: [HACKERS] Column COMMENTs in CREATE TABLE?

2016-07-02 Thread David Fetter
On Sat, Jul 02, 2016 at 01:06:49PM -0400, David G. Johnston wrote: > On Sat, Jul 2, 2016 at 12:55 PM, Marko Tiikkaja 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 > >

Re: [HACKERS] Column COMMENTs in CREATE TABLE?

2016-07-02 Thread Fabrízio de Royes Mello
Em sábado, 2 de julho de 2016, David G. Johnston escreveu: > On Sat, Jul 2, 2016 at 12:55 PM, Marko Tiikkaja > 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

Re: [HACKERS] Column COMMENTs in CREATE TABLE?

2016-07-02 Thread David G. Johnston
On Sat, Jul 2, 2016 at 12:55 PM, Marko Tiikkaja 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 t

[HACKERS] Column COMMENTs in CREATE TABLE?

2016-07-02 Thread Marko Tiikkaja
Hi, Currently we have CREATE TABLE statements in a git repository that look roughly like this: CREATE TABLE foo( -- the first field f1 int NOT NULL, -- the second field f2 int NOT NULL, ... ); But the problem is that those comments don't obviously make it all the way to the database,