Revert "Don't check for presence of a PRIMARY KEY if not replicating rows"
authorCraig Ringer <craig@2ndquadrant.com>
Fri, 3 Jul 2015 11:30:27 +0000 (19:30 +0800)
committerCraig Ringer <craig@2ndquadrant.com>
Fri, 3 Jul 2015 13:44:54 +0000 (21:44 +0800)
commita0b6306f7f55440902fca02deeda2b04a36ff021
tree66ea330cc3df8c61ca69a9d5c9a50212240840e3
parent18bba747fa8893ed14ea2aa178a908e04331b9bf
Revert "Don't check for presence of a PRIMARY KEY if not replicating rows"

This reverts commit 15abe5e5946c1542ecf43b42c69ba03c984d199f as the
initial change was too naïve.

The check shouldn't be within the loop.

It should run after the DDL lock check, since it could change data
in the table in ways that means the incoming DDL might not apply
anymore, e.g. inserting a NULL value into an otherwise NULL-free
table at the same time an
  ALTER TABLE ... ALTER COLUMN ... SET NOT NULL
comes in.

It's also necessary for it to be skipped if the node is read-only
so a check like  && !node_read_only is needed.
bdr_executor.c