Re: files ending with .1 or .2
От | Tom Lane |
---|---|
Тема | Re: files ending with .1 or .2 |
Дата | |
Msg-id | 3764.1098282773@sss.pgh.pa.us обсуждение исходный текст |
Ответ на | Re: files ending with .1 or .2 (Leonardo Francalanci <lfrancalanci@simtel.ie>) |
Список | pgsql-general |
Leonardo Francalanci <lfrancalanci@simtel.ie> writes: > Is there any documentation I can read about this? The best concise documentation I know about is in the CVS-tip docs for contrib/oid2name (reproduced below; the bit about tablespaces is irrelevant to pre-8.0 versions, but the rest is accurate). I've been wanting to transpose this into the mainstream admin docs, but haven't decided where to put it. regards, tom lane Databases are placed in directories named after their OIDs in pg_database, and the table files within a database's directory are named by "filenode" numbers, which are stored in pg_class.relfilenode. Note that while a table's filenode often matches its OID, this is *not* necessarily the case; some operations, like TRUNCATE, REINDEX, CLUSTER and some forms of ALTER TABLE, can change the filenode while preserving the OID. Avoid assuming that filenode and table OID are the same. When a table exceeds 1Gb, it is divided into gigabyte-sized "segments". The first segment's file name is the same as the filenode; subsequent segments are named filenode.1, filenode.2, etc. Tablespaces make the scenario more complicated. Each non-default tablespace has a symlink inside the pg_tblspc directory, which points to the physical tablespace directory (as specified in its CREATE TABLESPACE command). The symlink is named after the tablespace's OID. Inside the physical tablespace directory there is another directory for each database that has elements in the tablespace, named after the database's OID. Tables within that directory follow the filenode naming scheme. The "pg_default" tablespace is not addressed via pg_tblspc, but corresponds to $PGDATA/base.
В списке pgsql-general по дате отправления: