PostgreSQL Source Code git master
Loading...
Searching...
No Matches
pg_description.h
Go to the documentation of this file.
1/*-------------------------------------------------------------------------
2 *
3 * pg_description.h
4 * definition of the "description" system catalog (pg_description)
5 *
6 * Because the contents of this table are taken from the *.dat files
7 * of other catalogs, there is no pg_description.dat file. The initial
8 * contents are assembled by genbki.pl and loaded during initdb.
9 *
10 * NOTE: an object is identified by the OID of the row that primarily
11 * defines the object, plus the OID of the table that that row appears in.
12 * For example, a function is identified by the OID of its pg_proc row
13 * plus the pg_class OID of table pg_proc. This allows unique identification
14 * of objects without assuming that OIDs are unique across tables.
15 *
16 * Since attributes don't have OIDs of their own, we identify an attribute
17 * comment by the objoid+classoid of its parent table, plus an "objsubid"
18 * giving the attribute column number. "objsubid" must be zero in a comment
19 * for a table itself, so that it is distinct from any column comment.
20 * Currently, objsubid is unused and zero for all other kinds of objects,
21 * but perhaps it might be useful someday to associate comments with
22 * constituent elements of other kinds of objects (arguments of a function,
23 * for example).
24 *
25 *
26 * Portions Copyright (c) 1996-2026, PostgreSQL Global Development Group
27 * Portions Copyright (c) 1994, Regents of the University of California
28 *
29 * src/include/catalog/pg_description.h
30 *
31 * NOTES
32 * The Catalog.pm module reads this file and derives schema
33 * information.
34 *
35 *-------------------------------------------------------------------------
36 */
37#ifndef PG_DESCRIPTION_H
38#define PG_DESCRIPTION_H
39
40#include "catalog/genbki.h"
41#include "catalog/pg_description_d.h" /* IWYU pragma: export */
42
43/* ----------------
44 * pg_description definition. cpp turns this into
45 * typedef struct FormData_pg_description
46 * ----------------
47 */
49{
50 Oid objoid; /* OID of object itself */
51 Oid classoid; /* OID of table containing object */
52 int32 objsubid; /* column number, or 0 if not used */
53
54#ifdef CATALOG_VARLEN /* variable-length fields start here */
55 text description BKI_FORCE_NOT_NULL; /* description of object */
56#endif
58
59/* ----------------
60 * Form_pg_description corresponds to a pointer to a tuple with
61 * the format of pg_description relation.
62 * ----------------
63 */
65
67
69
70/* We do not use BKI_LOOKUP here because it causes problems for genbki.pl */
71DECLARE_FOREIGN_KEY((classoid), pg_class, (oid));
72
73#endif /* PG_DESCRIPTION_H */
int32_t int32
Definition c.h:542
#define DECLARE_UNIQUE_INDEX_PKEY(name, oid, oidmacro, tblname, decl)
Definition genbki.h:86
#define DECLARE_FOREIGN_KEY(cols, reftbl, refcols)
Definition genbki.h:118
#define BKI_FORCE_NOT_NULL
Definition genbki.h:33
#define DECLARE_TOAST(name, toastoid, indexoid)
Definition genbki.h:63
#define CATALOG(name, oid, oidmacro)
Definition genbki.h:23
FormData_pg_description * Form_pg_description
FormData_pg_description
unsigned int Oid
static int fb(int x)
Definition c.h:706
const char * description