Improved SQL for postgresql.
Improved SQL for postgresql.

zammad/zammad,monotek/zammad,zammad/zammad,zammad/zammad,monotek/zammad,monotek/zammad,monotek/zammad,zammad/zammad,monotek/zammad,zammad/zammad,zammad/zammad,monotek/zammad