src/include/catalog/directory of the source tree. In particular, for each catalog there is a header file named after the catalog (e.g.,
pg_class), which defines the set of columns the catalog has, as well as some other basic properties such as its OID. Other critical files defining the catalog structure include
indexing.h, which defines the indexes present on all the system catalogs, and
toasting.h, which defines TOAST tables for catalogs that need one.
pg_class.hmust contain an entry for itself, as well as one for each other system catalog and index.) This initial data is kept in editable form in data files that are also stored in the
src/include/catalog/directory. For example,
pg_proc.datdescribes all the initial rows that must be inserted into the
postgres.bkifile used in this mode is prepared from the aforementioned header and data files, while building a PostgreSQL distribution, by a Perl script named
genbki.pl. Although it's specific to a particular PostgreSQL release,
postgres.bkiis platform-independent and is installed in the
sharesubdirectory of the installation tree.
genbki.plalso produces a derived header file for each catalog, for example
pg_classcatalog. This file contains automatically-generated macro definitions, and may contain other macros, enum declarations, and so on that can be useful for client C code that reads a particular catalog.