Sample Header Ad - 728x90

Restore PostgreSQL database from linux to MacOS with utf8 collated columns

3 votes
2 answers
219 views
I want to copy from a postgres db running on linux with column definition like: col1 varchar COLLATE "en_US.utf8" NULL; This collate does not exist on macos, or at least, it's called en_US.UTF-8. Because of this, a restore from a backup made with pg_dump will fail on these tables. I tried to remove the collation specification from the ddl in the backups: there seems to be two files: restore.sql and toc.dat, both of them containing the ddls for some reason. Removing from the first achieves nothing, and removing it from the second leaves the file corrupted even if I go in with a hex editor and remove the exact bytes. (I also tried to create this collation on macos, at which i failed miserably.) I wonder if somebody encountered this scenario, and what would be the solution here.
Asked by sifear (53 rep)
Jun 17, 2025, 05:17 AM
Last activity: Jun 18, 2025, 10:37 PM