fix error in schema.pgsql and pgsql patch