diff options
author | arcadia-devtools <arcadia-devtools@yandex-team.ru> | 2022-03-03 15:11:51 +0300 |
---|---|---|
committer | arcadia-devtools <arcadia-devtools@yandex-team.ru> | 2022-03-03 15:11:51 +0300 |
commit | 4987b564a17b88bee8c7ab434bdc053c5440e46f (patch) | |
tree | e3187a2aeb42c27635864a6f6d8c6792047ed76e /contrib/libs/postgresql/src/include/catalog/genbki.h | |
parent | a5d3b02fe5c80d9fb8a6fe5e9c486e45046c0291 (diff) | |
download | ydb-4987b564a17b88bee8c7ab434bdc053c5440e46f.tar.gz |
intermediate changes
ref:73c1399b919c53b6b72f20d0e9f66f789717fc47
Diffstat (limited to 'contrib/libs/postgresql/src/include/catalog/genbki.h')
-rw-r--r-- | contrib/libs/postgresql/src/include/catalog/genbki.h | 76 |
1 files changed, 71 insertions, 5 deletions
diff --git a/contrib/libs/postgresql/src/include/catalog/genbki.h b/contrib/libs/postgresql/src/include/catalog/genbki.h index 4a6c8636da..b1fee54d3c 100644 --- a/contrib/libs/postgresql/src/include/catalog/genbki.h +++ b/contrib/libs/postgresql/src/include/catalog/genbki.h @@ -9,7 +9,7 @@ * bootstrap file from these header files.) * * - * Portions Copyright (c) 1996-2020, PostgreSQL Global Development Group + * Portions Copyright (c) 1996-2021, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/catalog/genbki.h @@ -36,18 +36,84 @@ /* Specifies a default value for auto-generated array types */ #define BKI_ARRAY_DEFAULT(value) /* - * Indicates how to perform name lookups, typically for an OID or - * OID-array field + * Indicates that the attribute contains OIDs referencing the named catalog; + * can be applied to columns of oid, regproc, oid[], or oidvector type. + * genbki.pl uses this to know how to perform name lookups in the initial + * data (if any), and it also feeds into regression-test validity checks. + * The _OPT suffix indicates that values can be zero instead of + * a valid OID reference. */ #define BKI_LOOKUP(catalog) +#define BKI_LOOKUP_OPT(catalog) + +/* + * These lines are processed by genbki.pl to create the statements + * the bootstrap parser will turn into BootstrapToastTable commands. + * Each line specifies the system catalog that needs a toast table, + * the OID to assign to the toast table, and the OID to assign to the + * toast table's index. The reason we hard-wire these OIDs is that we + * need stable OIDs for shared relations, and that includes toast tables + * of shared relations. + * + * The macro definition is just to keep the C compiler from spitting up. + */ +#define DECLARE_TOAST(name,toastoid,indexoid) extern int no_such_variable + +/* + * These lines are processed by genbki.pl to create the statements + * the bootstrap parser will turn into DefineIndex calls. + * + * The keyword is DECLARE_INDEX or DECLARE_UNIQUE_INDEX or + * DECLARE_UNIQUE_INDEX_PKEY. ("PKEY" marks the index as being the catalog's + * primary key; currently this is only cosmetically different from a regular + * unique index. By convention, we usually make a catalog's OID column its + * pkey, if it has one.) The first two arguments are the index's name and + * OID, the rest is much like a standard 'create index' SQL command. + * + * For each index, we also provide a #define for its OID. References to + * the index in the C code should always use these #defines, not the actual + * index name (much less the numeric OID). + * + * The macro definitions are just to keep the C compiler from spitting up. + */ +#define DECLARE_INDEX(name,oid,decl) extern int no_such_variable +#define DECLARE_UNIQUE_INDEX(name,oid,decl) extern int no_such_variable +#define DECLARE_UNIQUE_INDEX_PKEY(name,oid,decl) extern int no_such_variable + +/* + * These lines are processed by genbki.pl to create a table for use + * by the pg_get_catalog_foreign_keys() function. We do not have any + * mechanism that actually enforces foreign-key relationships in the + * system catalogs, but it is still useful to record the intended + * relationships in a machine-readable form. + * + * The keyword is DECLARE_FOREIGN_KEY[_OPT] or DECLARE_ARRAY_FOREIGN_KEY[_OPT]. + * The first argument is a parenthesized list of the referencing columns; + * the second, the name of the referenced table; the third, a parenthesized + * list of the referenced columns. Use of the ARRAY macros means that the + * last referencing column is an array, each of whose elements is supposed + * to match some entry in the last referenced column. Use of the OPT suffix + * indicates that the referencing column(s) can be zero instead of a valid + * reference. + * + * Columns that are marked with a BKI_LOOKUP rule do not need an explicit + * DECLARE_FOREIGN_KEY macro, as genbki.pl can infer the FK relationship + * from that. Thus, these macros are only needed in special cases. + * + * The macro definitions are just to keep the C compiler from spitting up. + */ +#define DECLARE_FOREIGN_KEY(cols,reftbl,refcols) extern int no_such_variable +#define DECLARE_FOREIGN_KEY_OPT(cols,reftbl,refcols) extern int no_such_variable +#define DECLARE_ARRAY_FOREIGN_KEY(cols,reftbl,refcols) extern int no_such_variable +#define DECLARE_ARRAY_FOREIGN_KEY_OPT(cols,reftbl,refcols) extern int no_such_variable /* The following are never defined; they are here only for documentation. */ /* * Variable-length catalog fields (except possibly the first not nullable one) * should not be visible in C structures, so they are made invisible by #ifdefs - * of an undefined symbol. See also MARKNOTNULL in bootstrap.c for how this is - * handled. + * of an undefined symbol. See also the BOOTCOL_NULL_AUTO code in bootstrap.c + * for how this is handled. */ #undef CATALOG_VARLEN |