Laurenz Albe <laurenz.albe@xxxxxxxxxxx> writes: > I would have to see the dump to be certain, but my guess is that you need to make the function > independent from the current setting of "search_path" by schema-qualifying the data type: > DECLARE > _row my_schema.row_reporting_p; Yeah, that seems likely to be the explanation. The restore will be run under a restrictive search_path and functions that are not ready for that will fail. It may well be that this isn't the only search_path dependency in the function, in which case you might be better advised to add a "SET search_path" option to the function, instead of trying to fix all the references manually. regards, tom lane