data modifying WITH seems to drop rows in cascading updates -- bug? - Mailing list pgsql-bugs

From Merlin Moncure
Subject data modifying WITH seems to drop rows in cascading updates -- bug?
Date
Msg-id CAHyXU0zkt6KssjEsWd+AZ7mfUC42h+bewOq-VLv7mn1DHkXmoQ@mail.gmail.com
Whole thread Raw
In response to Re: data modifying WITH seems to drop rows in cascading updates -- bug?  (Marko Tiikkaja <marko@joh.to>)
List pgsql-bugs
On Saturday, August 24, 2019, Marko Tiikkaja <marko@joh.to> wrote:
On Sat, Aug 24, 2019 at 6:33 AM Merlin Moncure <mmoncure@gmail.com> wrote:
Right.  Shame on me for not checking the docs before posting.  Simply stated, this is undefined behavior.

Nah; it's defined, yet unpredictable behavior.  Still worth half the points, I guess.

Lack of prediction on outputs is a class of undefined behavior.  If a program is left in unknown state (including results returned to caller) this meets the classic definition of undefined.   I realize this is purely semantic pedantry but in language design these distinctions are important and fun to discuss.

Undefined behavior is good.  It allows for future refinements of the model and frees the caller from expectations against the result; if some fast, clever way of managing these cases is somehow innovated the behavior can be defined later without breaking compatibility. 

FYI: this thread exists as it was turned up during the process of teaching yet another convert the cooler stuff with postgres and he's now getting into wCTE.  I visibly saw the light bulb go off...he's ours now.  I'm a fan of your work 

merlin
 

pgsql-bugs by date:

Previous
From: Marko Tiikkaja
Date:
Subject: Re: data modifying WITH seems to drop rows in cascading updates -- bug?
Next
From: Georg Sauthoff
Date:
Subject: Re: BUG #15961: psql should be able to read password from stdin