Re: BUG #14900: MView not null constraint

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: neil(at)postgrescompare(dot)com
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #14900: MView not null constraint
Date: 2017-11-12 17:12:33
Message-ID: 1980.1510506753@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

neil(at)postgrescompare(dot)com writes:
> This is probably not a bug

Nope, it isn't.

> If it's not a bug should postgres support
> ALTER MATERIALIZED VIEW ALTER COLUMN column SET NOT NULL syntax?

Doesn't seem like a great idea to me. What's supposed to happen
if a view update would result in a violation of the constraint?
It's way too late to undo whatever change of the underlying data
caused that, so it seems like the only possible answer is for
REFRESHes to fail, resulting in the view getting more and more
out of date until and unless something manual is done to resolve
the problem. I can't see that that's a useful behavior to have.

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2017-11-12 17:39:12 Re: BUG #14897: Segfault on statitics SQL request
Previous Message neil 2017-11-12 03:16:21 BUG #14900: MView not null constraint