pg_restore fails with ERROR: could not create directory "pg_tblspc/16400/PG_11_201809051/16403": Invalid argument
0
votes
0
answers
403
views
Trying to migrate PG9.1 data to PG11.5
I did initdb using the following command.
"\bin\initdb.exe" --locale="English_Malaysia.1252" -D "\pgupgrade" -U --pwfile
Command output:
The files belonging to this database system will be owned by user "Administrator".
This user must also own the server process.
The database cluster will be initialized with locale "English_Malaysia.1252".
The default database encoding has accordingly been set to "WIN1252".
The default text search configuration will be set to "english".
Part of pg_upgrade the following is failing:
command: "/pg_restore" --port 50432 --username --create --exit-on-error --verbose --dbname template1 "pg_upgrade_dump_16388.custom" >> "pg_upgrade_dump_16388.log" 2>&1
pg_restore: connecting to database for restore
pg_restore: creating DATABASE "xyz"
pg_restore: [archiver (db)] Error while PROCESSING TOC:
pg_restore: [archiver (db)] Error from TOC entry 4037; 1262 16388 DATABASE xyz
pg_restore: [archiver (db)] could not execute query: ERROR: could not create directory "pg_tblspc/16400/PG_11_201809051/16403": Invalid argument
Command was: CREATE DATABASE "xyz" WITH TEMPLATE = template0 ENCODING = 'UTF8' LC_COLLATE = 'English_Malaysia.1252' LC_CTYPE = 'English_Malaysia.1252' TABLESPACE = "xyz";
Can anyone tell me the possible cause of failure? Is it encoding issue? in first case DB was initialized with win1252 but during pg_restore it is running with utf8.
Also can you tell me how can I troubleshoot this error further as I am not getting what is "invalid argument" here?
Asked by Neeraj Bansal
(153 rep)
Jun 13, 2023, 03:28 PM