Re: clean up docs for v12

From: Andres Freund <andres(at)anarazel(dot)de>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Michael Paquier <michael(at)paquier(dot)xyz>, Justin Pryzby <pryzby(at)telsasoft(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: clean up docs for v12
Date: 2019-04-22 18:22:20
Message-ID: 20190422182220.x6ypkadyga4i6cq2@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On 2019-04-22 14:17:48 -0400, Tom Lane wrote:
> Andres Freund <andres(at)anarazel(dot)de> writes:
> > On 2019-04-22 13:27:17 -0400, Tom Lane wrote:
> >> I wonder
> >> also if it wouldn't be smart to explicitly check that the "guaranteeing"
> >> column is not attisdropped.
>
> > Yea, that probably would be smart. I don't think there's an active
> > problem, because we remove NOT NULL when deleting an attribute, but it
> > seems good to be doubly sure / explain why that's safe:
> > /* Remove any NOT NULL constraint the column may have */
> > attStruct->attnotnull = false;
> > I'm a bit unsure whether to make it an assert, elog(ERROR) or just not
> > assume column presence?
>
> I'd just make the code look like
>
> /*
> * If it's NOT NULL then it must be present in every tuple,
> * unless there's a "missing" entry that could provide a non-null
> * value for it. Out of paranoia, also check !attisdropped.
> */
> if (att->attnotnull &&
> !att->atthasmissing &&
> !att->attisdropped)
> guaranteed_column_number = attnum;
>
> I don't think the extra check is so expensive as to be worth obsessing
> over.

Oh, yea, the cost is irrelevant here - it's one-off work basically, and
pales in comparison to the cost of JITing. I was more thinking about
whether it's worth "escalating" the violation of assumptions.

Greetings,

Andres Freund

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2019-04-22 18:22:53 Re: clean up docs for v12
Previous Message Andres Freund 2019-04-22 18:20:50 Re: pg_dump is broken for partition tablespaces