! Fix assorted issues with upgrade on PostgreSQL

Signed-off-by: Michael Eshom <oldiesmann@oldiesmann.us>