Sample Header Ad - 728x90

pg_upgradecluster fails with 'tablespace directory "" does not exist' error

2 votes
1 answer
246 views
I'm trying to upgrade a Postgres cluster from PG 12 to PG 15 using this command :
sudo pg_upgradecluster 12 main --method=link
My cluster uses some tablespaces:
postgres=# SELECT oid, spcname, pg_tablespace_location(oid) FROM pg_tablespace;
    oid     |      spcname       |      pg_tablespace_location      
------------+--------------------+----------------------------------
       1664 | pg_global          | 
       1663 | default_old        | 
 1905123481 | ts1                | /mnt/postgres/ts1
 1905522771 | ts2                | /mnt/postgres/ts2
 1905595436 | ts3                | /mnt/postgres/ts3
When I run the pg_upgradecluster script, it fails immediately with this error :
tablespace directory "" does not exist
All the tablespaces are located on different disks I've already upgraded another cluster which doesn't have tablespaces from PG 12 to PG 15 without any errors. I don't understand what to do now :( does anyone faced this issue before and knows how to fix it ?? Thanks in advance
Asked by PEPin (51 rep)
Jan 20, 2024, 09:48 AM
Last activity: Jul 13, 2024, 07:58 AM