Index: src/providers/postgres/qgspostgresprovider.cpp =================================================================== --- src/providers/postgres/qgspostgresprovider.cpp (revision 8290) +++ src/providers/postgres/qgspostgresprovider.cpp (working copy) @@ -393,17 +393,25 @@ continue; const QString &type = fld.typeName(); - if( type == "money" || type.startsWith("_") ) + if( type == "money" ) { // money and arrays don't support cast to text, but return text // TODO: check other types - declare += "," + quotedIdentifier( fieldname ); + declare += QString(",cash_out(%1) AS %1") + .arg( quotedIdentifier( fieldname ) ); } + else if( type.startsWith("_") ) + { + // money and arrays don't support cast to text, but return text + // TODO: check other types + declare += QString(",array_out(%1) AS %1") + .arg( quotedIdentifier( fieldname ) ); + } else if( type == "bool" ) { // bool doesn't support cast to text either and even doesn't return text. // (even text() doesn't work with binary cursors) - declare += QString(",CASE WHEN %1 THEN 't' WHEN NOT %1 THEN 'f' ELSE NULL END AS %1") + declare += QString(",boolout(%1) AS %1") .arg( quotedIdentifier(fieldname) ); } else