I had to modify the portion that copies FK constraint: https://gist.github.com/mlibrodo/6f246c483e650dc716eba752a9d3c79a Basically, the issue on my end was that the FK constraints on the cloned(destination) schema seem to reference the source_schema
pgsql-general by date:
Соглашаюсь с условиями обработки персональных данных