PostgreSQL Source Code  git master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
toasting.h
Go to the documentation of this file.
1 /*-------------------------------------------------------------------------
2  *
3  * toasting.h
4  * This file provides some definitions to support creation of toast tables
5  *
6  *
7  * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
8  * Portions Copyright (c) 1994, Regents of the University of California
9  *
10  * src/include/catalog/toasting.h
11  *
12  *-------------------------------------------------------------------------
13  */
14 #ifndef TOASTING_H
15 #define TOASTING_H
16 
17 #include "storage/lock.h"
18 
19 /*
20  * toasting.c prototypes
21  */
22 extern void NewRelationCreateToastTable(Oid relOid, Datum reloptions);
23 extern void NewHeapCreateToastTable(Oid relOid, Datum reloptions,
24  LOCKMODE lockmode);
25 extern void AlterTableCreateToastTable(Oid relOid, Datum reloptions,
26  LOCKMODE lockmode);
27 extern void BootstrapToastTable(char *relName,
28  Oid toastOid, Oid toastIndexOid);
29 
30 
31 /*
32  * This macro is just to keep the C compiler from spitting up on the
33  * upcoming commands for genbki.pl.
34  */
35 #define DECLARE_TOAST(name,toastoid,indexoid) extern int no_such_variable
36 
37 
38 /*
39  * What follows are lines processed by genbki.pl to create the statements
40  * the bootstrap parser will turn into BootstrapToastTable commands.
41  * Each line specifies the system catalog that needs a toast table,
42  * the OID to assign to the toast table, and the OID to assign to the
43  * toast table's index. The reason we hard-wire these OIDs is that we
44  * need stable OIDs for shared relations, and that includes toast tables
45  * of shared relations.
46  */
47 
48 /* normal catalogs */
49 DECLARE_TOAST(pg_attrdef, 2830, 2831);
50 DECLARE_TOAST(pg_constraint, 2832, 2833);
51 DECLARE_TOAST(pg_description, 2834, 2835);
52 DECLARE_TOAST(pg_proc, 2836, 2837);
53 DECLARE_TOAST(pg_rewrite, 2838, 2839);
54 DECLARE_TOAST(pg_seclabel, 3598, 3599);
55 DECLARE_TOAST(pg_statistic, 2840, 2841);
56 DECLARE_TOAST(pg_trigger, 2336, 2337);
57 
58 /* shared catalogs */
59 DECLARE_TOAST(pg_shdescription, 2846, 2847);
60 #define PgShdescriptionToastTable 2846
61 #define PgShdescriptionToastIndex 2847
62 DECLARE_TOAST(pg_db_role_setting, 2966, 2967);
63 #define PgDbRoleSettingToastTable 2966
64 #define PgDbRoleSettingToastIndex 2967
65 DECLARE_TOAST(pg_shseclabel, 4060, 4061);
66 #define PgShseclabelToastTable 4060
67 #define PgShseclabelToastIndex 4061
68 
69 #endif /* TOASTING_H */
int LOCKMODE
Definition: lockdefs.h:26
void NewRelationCreateToastTable(Oid relOid, Datum reloptions)
Definition: toasting.c:71
void BootstrapToastTable(char *relName, Oid toastOid, Oid toastIndexOid)
Definition: toasting.c:95
unsigned int Oid
Definition: postgres_ext.h:31
void AlterTableCreateToastTable(Oid relOid, Datum reloptions, LOCKMODE lockmode)
Definition: toasting.c:59
uintptr_t Datum
Definition: postgres.h:374
#define DECLARE_TOAST(name, toastoid, indexoid)
Definition: toasting.h:35
void NewHeapCreateToastTable(Oid relOid, Datum reloptions, LOCKMODE lockmode)
Definition: toasting.c:65