pgsql: Avoid Python memory leaks in hstore_plpython and jsonb_plpython.

2019-04-06 Thread Tom Lane
Avoid Python memory leaks in hstore_plpython and jsonb_plpython. Fix some places where we might fail to do Py_DECREF() on a Python object (thereby leaking it for the rest of the session). Almost all of the risks were in error-recovery paths, which we don't really expect to hit anyway. Hence, whi

pgsql: Fix failures in validateForeignKeyConstraint's slow path.

2019-04-06 Thread Tom Lane
Fix failures in validateForeignKeyConstraint's slow path. The foreign-key-checking loop in ATRewriteTables failed to ignore relations without storage (e.g., partitioned tables), unlike the initial loop. This accidentally worked as long as RI_Initial_Check succeeded, which it does in most practica

pgsql: Fix failures in validateForeignKeyConstraint's slow path.

2019-04-06 Thread Tom Lane
Fix failures in validateForeignKeyConstraint's slow path. The foreign-key-checking loop in ATRewriteTables failed to ignore relations without storage (e.g., partitioned tables), unlike the initial loop. This accidentally worked as long as RI_Initial_Check succeeded, which it does in most practica