#613030 by lportela: PostgreSQL support; make sure all columns used in ORDER-clause occur in SELECT-clause as well