Re: NOT NULL markings for BKI columns

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andres Freund <andres(at)2ndquadrant(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: NOT NULL markings for BKI columns
Date: 2015-02-15 17:54:45
Message-ID: 21364.1424022885@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Andres Freund <andres(at)2ndquadrant(dot)com> writes:
> On 2015-02-15 12:31:10 -0500, Tom Lane wrote:
>> Where are you thinking of sticking that exactly, and will pgindent
>> do something sane with it?

> Hm, I was thinking about
> /* extversion should never be null, but the others can be. */
> text extversion PG_FORCENOTNULL; /* extension version name */
> but pgindent then removes some of the space between text and extversion,
> making it
> text extversion PG_FORCENOTNULL; /* extension version name */
> an alternative where it doesn't do that is
> text PG_FORCENOTNULL(extversion); /* extension version name */

> Not sure what's the best way here.

The former is clearly a lot more sane semantically, so I'd go with
that even if the whitespace is a bit less nice.

I notice that pgindent does a similar not-very-nice thing with
PG_USED_FOR_ASSERTS_ONLY. I wonder if we could hack it to handle
those two identifiers specially?

BTW, the precedent of PG_USED_FOR_ASSERTS_ONLY would suggest calling
this one PG_FORCE_NOT_NULL, or at least using underscores for word
breaks in whatever we end up calling it.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Petr Jelinek 2015-02-15 18:40:24 Re: Sequence Access Method WIP
Previous Message Andres Freund 2015-02-15 17:43:30 Re: NOT NULL markings for BKI columns