Polycondensates having carboxylic or carbonic ester groups in the main chain