Reordering bind values and params to prevent an incorrect number
of parameters being passed to the postgresql adapter. Fixes #12753.