fix brainfsck with pgsql upgrade script.

refs #4953