PostgreSQL Source Code git master
pg_namespace.h
Go to the documentation of this file.
1/*-------------------------------------------------------------------------
2 *
3 * pg_namespace.h
4 * definition of the "namespace" system catalog (pg_namespace)
5 *
6 *
7 * Portions Copyright (c) 1996-2025, PostgreSQL Global Development Group
8 * Portions Copyright (c) 1994, Regents of the University of California
9 *
10 * src/include/catalog/pg_namespace.h
11 *
12 * NOTES
13 * The Catalog.pm module reads this file and derives schema
14 * information.
15 *
16 *-------------------------------------------------------------------------
17 */
18#ifndef PG_NAMESPACE_H
19#define PG_NAMESPACE_H
20
21#include "catalog/genbki.h"
22#include "catalog/pg_namespace_d.h" /* IWYU pragma: export */
23#include "utils/acl.h"
24
25/* ----------------------------------------------------------------
26 * pg_namespace definition.
27 *
28 * cpp turns this into typedef struct FormData_pg_namespace
29 *
30 * nspname name of the namespace
31 * nspowner owner (creator) of the namespace
32 * nspacl access privilege list
33 * ----------------------------------------------------------------
34 */
35CATALOG(pg_namespace,2615,NamespaceRelationId)
36{
37 Oid oid; /* oid */
38
39 NameData nspname;
40 Oid nspowner BKI_DEFAULT(POSTGRES) BKI_LOOKUP(pg_authid);
41
42#ifdef CATALOG_VARLEN /* variable-length fields start here */
43 aclitem nspacl[1];
44#endif
46
47/* ----------------
48 * Form_pg_namespace corresponds to a pointer to a tuple with
49 * the format of pg_namespace relation.
50 * ----------------
51 */
53
54DECLARE_TOAST(pg_namespace, 4163, 4164);
55
56DECLARE_UNIQUE_INDEX(pg_namespace_nspname_index, 2684, NamespaceNameIndexId, pg_namespace, btree(nspname name_ops));
57DECLARE_UNIQUE_INDEX_PKEY(pg_namespace_oid_index, 2685, NamespaceOidIndexId, pg_namespace, btree(oid oid_ops));
58
59MAKE_SYSCACHE(NAMESPACENAME, pg_namespace_nspname_index, 4);
60MAKE_SYSCACHE(NAMESPACEOID, pg_namespace_oid_index, 16);
61
62/*
63 * prototypes for functions in pg_namespace.c
64 */
65extern Oid NamespaceCreate(const char *nspName, Oid ownerId, bool isTemp);
66
67#endif /* PG_NAMESPACE_H */
#define BKI_LOOKUP(catalog)
Definition: genbki.h:46
#define BKI_DEFAULT(value)
Definition: genbki.h:35
DECLARE_UNIQUE_INDEX_PKEY(pg_namespace_oid_index, 2685, NamespaceOidIndexId, pg_namespace, btree(oid oid_ops))
MAKE_SYSCACHE(NAMESPACENAME, pg_namespace_nspname_index, 4)
DECLARE_UNIQUE_INDEX(pg_namespace_nspname_index, 2684, NamespaceNameIndexId, pg_namespace, btree(nspname name_ops))
DECLARE_TOAST(pg_namespace, 4163, 4164)
FormData_pg_namespace * Form_pg_namespace
Definition: pg_namespace.h:52
FormData_pg_namespace
Definition: pg_namespace.h:45
CATALOG(pg_namespace, 2615, NamespaceRelationId)
Definition: pg_namespace.h:35
Oid NamespaceCreate(const char *nspName, Oid ownerId, bool isTemp)
Definition: pg_namespace.c:43
unsigned int Oid
Definition: postgres_ext.h:32
Definition: c.h:698