という新しい表領域を作成しました。いくつかの表と索引を含んでいindexes
た古い表領域を削除しようとしています。indexes_old
テーブルスペースを削除しようとすると、次のようになります。
=> drop tablespace indexes_old;
ERROR: tablespace "indexes_old" is not empty
しかし、そこにあるものを確認しようとすると、そのテーブルスペースにテーブルが存在しないようです:
=> select * from pg_tables where tablespace = 'indexes_old';
schemaname | tablename | tableowner | tablespace | hasindexes | hasrules | hastriggers
------------+-----------+------------+------------+------------+----------+-------------
(0 rows)
=> select * from pg_indexes where tablespace = 'indexes_old';
schemaname | tablename | indexname | tablespace | indexdef
------------+-----------+-----------+------------+----------
(0 rows)
では、ドロップを妨げているテーブルスペースには何がありますか?
念のため、pg_upgrade ツールを使用して Pg 8.4 から Pg 9.0 に移行しました。
テーブルスペースは次のようになります。
Name | Owner | Location | Access privileges | Description
-------------+----------+-----------------+-------------------+-------------
indexes | nobody | /data/pgindex90 | |
indexes_old | nobody | /data/pgindex84 | |
/data/pgindex84 の内容には、すべての古い 8.4 インデックスに加えて、pg_upgrade が自動的に作成したこの新しい 9.0 インデックスが含まれます
# sudo ls -al /data/pgindex84/PG_9.0_201008051/11874
total 8280
drwx------ 2 postgres postgres 4096 Feb 9 14:58 .
drwx------ 3 postgres postgres 4096 Feb 11 09:28 ..
-rw------- 1 postgres postgres 40960 Feb 9 14:58 10462602
-rw------- 1 postgres postgres 40960 Feb 9 14:58 10462604
-rw------- 1 postgres postgres 4644864 Feb 9 14:58 10462614
-rw------- 1 postgres postgres 3727360 Feb 9 14:58 10462616