changed queries for pg
Merge branch 'dev' of github.com:nZEDb/nZEDb into dev