PostgreSQL: add query method

Signed-off-by: swpd <swpdtz@gmail.com>