Use pg_result_error, not pg_last_error, as the latter gives false negatives.
authorGreg Sabino Mullane <greg@endpoint.com>
Tue, 9 Feb 2016 16:38:21 +0000 (11:38 -0500)
committerGreg Sabino Mullane <greg@endpoint.com>
Thu, 11 Feb 2016 04:10:19 +0000 (23:10 -0500)
commit290829ae0dc74488f8c97ba2c66cc2ee2d9380b0
tree97ededbaf4e0ae2a1ca308be1778ebc2938b5737
parent46fdbb4c0ee144300e0cf277fde286136aea674d
Use pg_result_error, not pg_last_error, as the latter gives false negatives.

Specifically in the savepoint part of the code, where a failed query inside the
savepoint gives a non-false reply to pg_last_error by the time we call it,
which then leads to us doing 'RELEASE' instead of 'ROLLBACK TO', and causes
all sorts of mayhem.

The whole system needs a little cleanup, but this is an important bandaid.

Change-Id: I0223a3599816db5650f45863400e6194468d4361
includes/db/DatabasePostgres.php