Lightweight implementation of distributed queries to postgreSQL