Полезная информация

17.2. Access Methods

The pg_am table contains one row for every index access method. Support for the heap access method is built into PostgreSQL, but all other access methods are described in pg_am. The schema is shown in Table 17-1.

Table 17-1. Index Access Method Schema

ColumnDescription
amnamename of the access method
amowneruser ID of the owner (currently not used)
amstrategiesnumber of strategies for this access method (see below)
amsupportnumber of support routines for this access method (see below)
amorderstrategyzero if the index offers no sort order, otherwise the strategy number of the strategy operator that describes the sort order
amcanuniquedoes AM support unique indexes?
amcanmulticoldoes AM support multicolumn indexes?
amindexnullsdoes AM support NULL index entries?
amconcurrentdoes AM support concurrent updates?
amgettuple 
aminsert 
...procedure identifiers for interface routines to the access method. For example, regproc IDs for opening, closing, and getting rows from the access method appear here.

The object ID of the row in pg_am is used as a foreign key in a lot of other tables. You do not need to add a new row to this table; all that you are interested in is the object ID of the access method you want to extend:

SELECT oid FROM pg_am WHERE amname = 'btree';

 oid
-----
 403
(1 row)

We will use that query in a WHERE clause later.