Right now after 24h of restore, I notice weird behaviour, so I have several questions about it:
+ 11 postgres backend processes are sleeping as "TRUNCATE TABLE waiting". I see that they are waiting to issue a TRUNCATE for one of the partitions and then COPY data to it. Checking the log I see that several partitions have already been copied finished, but many more are left to start.
Why is a TRUNCATE needed at the start of a partition's COPY phase? I didn't issue a --clean on the command line (I don't need it as my database is newly created), and I don't see a mention of related TRUNCATE in the pg_restore manual.
TRUNCATE statements inside of "toc.dat" files? I'm skeptical.
Are you maybe doing something else in that database besides pg_restore?