Disclosed is a pharmaceutical composition comprising a water insoluble polymer matrix that comprises a bioerodable polyester polymer or a fatty acid based polyester polymer, or a mixture of both polymers, wherein the polymer matrix has a melting point of less than 60° C., and wherein the composition is liquid or paste at room temperature and is formulated to occlude a punctual channel in a subject and conforms to the shape of the canalicular or punctal channel.