This page in other versions: Unsupported versions: 7.2 / 7.3

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

Column Description
amname name of the access method
amowner user ID of the owner (currently not used)
amstrategies number of strategies for this access method (see below)
amsupport number of support routines for this access method (see below)
amorderstrategy zero if the index offers no sort order, otherwise the strategy number of the strategy operator that describes the sort order
amcanunique does AM support unique indexes?
amcanmulticol does AM support multicolumn indexes?
amindexnulls does AM support NULL index entries?
amconcurrent does 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.

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group