Restore a Discourse backup manually for development

got the memory error while trying to run the psql $DATABASE < dump.sql command:

ERROR: out of memory DETAIL: Cannot enlarge string buffer containing 0 bytes by 1328821374 more bytes.

is there any way to run the psql command on some part of the database, e.g. only on the tag-table so that one can delete some duplicated tags therein?


the problem is that I have a corrupted backup, which has duplicated tags. we need to restore the backup, because of some upload-lost during the site migration.

I need this in order to be able to do the restoration of that corrupted backup via UI (explained shortly here).