When and where are rules used by PostgreSQL?