adding pg-query