Fix sorting for postgres. Does not treat nulls same as sqlite.

http://stackoverflow.com/a/7055259/2137281