For back versions, i think because this patch changes xpath() behavior, we will only apply this to future versions. The old behavior is wrong (according to XPath standard) for not including namespaces, but maybe there are some application that depends on the old behavior.
Reviewing the behavior on 9.3, now i think the old behavior isn't usable (the resulting xml is not even processable in postgres):
# select xpath('//b:b', unnest(xpath('//a:b', '<b:a xmlns:b="http://test.com/a"><b:b>1</b:b><b:b>2</b:b></b:a>'::xml, array[array['a','http://test.com/a']]))); ERROR: could not parse XML document DETAIL: line 1: Namespace prefix b on b is not defined <b:b>1</b:b>
Maybe some application uses the result directly, but correct xml-using applications should handle namespace correctly, so if '<b:b>1</b:b>' becomes '<b:b xmlns:b="http://test.com/a' >1</b:b>', there should be no issue in those applications.