added PostgreSql Function for querying users