With this commit the new setting "standard_conforming_strings" was added:
rMW71d5b68221002d71c88783acab7df267a4e04cec
Some of my users (MediaWiki 1.19, PHP 5.2.5, PostgreSQL 8.4.1) has not enough rights to change this setting:
http://www.wiki-forum.de/installationsprobleme-der-version-1-19-0-t347486.htm
It should be a problem in the recent MW version as well.
I suggest to check first if the necessary rights are available. If this is not possible (sorry I'm not a PostgrSQL user) there should be check at least a check if the setting is necessary. By PostgrSQL 9.1 the default is "ON". So there is not need to check. Lower versions could be checked through the following query:
SHOW standard_conforming_strings;