With this commit the new setting "standard_conforming_strings" was added:
Some of my users (MediaWiki 1.19, PHP 5.2.5, PostgreSQL 8.4.1) has not enough rights to change this setting:
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: