Applying next part of pg patch: f2fb395f6978545945948a88b5460915811d8175