Maybe not “simpler” but for all those checks you could write a single query that pulls out all the data at once into a record variable and test against the columns pf that instead of executing multiple queries.
pgsql-general by date:
Соглашаюсь с условиями обработки персональных данных