On Mon, Jul 10, 2017 at 10:25 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> From "CREATE TABLE": > "A constraint that is not deferrable will be checked immediately after > every command."
> I think the above should be "after every row" instead of "after every > command".
I believe that FK constraints work differently from indexes in this regard. Not sure that we want to get into that level of detail here.
Since three of the 4 types are done "after every row" if we want to simplify (I'm leaning toward being precise here) I'd rather be imprecise about the FK. Pretending that a FK change is checked sooner than it really is seems like a minor omission since the observed behavior isn't likely to be noticeable. Wondering why "update pk = pk + 1" doesn't work by default when PK constraints are checked "after every command" has been shown to be noticeable.