when i go into sql-8.2/base/ to check how much space does my table take, there are plenty of files named by a number. how can i find the specific file which stores my specific table and index for that table?
for example, i ordered the files by date (newest first) but there are several at that particular period:
-rw------- 1 postgres sql 1.0G Dec 4 13:41 15426233
-rw------- 1 postgres sql 149M Dec 4 13:41 15426233.4
-rw------- 1 postgres sql 1.0G Dec 4 13:41 15426233.3
drwx------ 3 postgres sql 75K Dec 4 13:40 .
-rw------- 1 postgres sql 1.0G Dec 4 13:34 15426233.2
-rw------- 1 postgres sql 1.0G Dec 4 13:28 15426233.1
-rw------- 1 postgres sql 3.6M Dec 4 11:23 1249
-rw------- 1 postgres sql 584K Dec 4 11:23 2659
-rw------- 1 postgres sql 672K Dec 4 11:23 2663
-rw------- 1 postgres sql 136K Dec 4 11:23 2662
-rw------- 1 postgres sql 848K Dec 4 11:23 2608
-rw------- 1 postgres sql 2.6M Dec 4 11:23 2658
-rw------- 1 postgres sql 600K Dec 4 11:23 2674
-rw------- 1 postgres sql 56K Dec 4 11:23 2679
-rw------- 1 postgres sql 632K Dec 4 11:23 2673
-rw------- 1 postgres sql 72K Dec 4 11:23 2678
-rw------- 1 postgres sql 1.8M Dec 4 11:22 2619
-rw------- 1 postgres sql 112K Dec 4 11:21 2696
-rw------- 1 postgres sql 1007M Dec 4 11:21 15426228.5
-rw------- 1 postgres sql 1.0G Dec 4 11:19 15426228.4
-rw------- 1 postgres sql 1.0G Dec 4 11:19 15426228.3
-rw------- 1 postgres sql 1.0G Dec 4 11:18 15426228.2
-rw------- 1 postgres sql 1.0G Dec 4 11:17 15426228.1
-rw------- 1 postgres sql 1.0G Dec 4 11:16 15426228
Each directory represents a database (created via
create database). The number is the oid of the database. To see the oid and its name, run the following statement:Inside each directory each file corresponds to the an entry in
pg_classwhere the oid matches the number of the file in the directory:You can see the oids and to which relation they relate by running the statement:
You might also want to check out the manual
Btw: if you are really still running 8.2 you should upgrade as soon as possible.