Fix query for wiki pages listing to work on postgreSQL