1 | /*------------------------------------------------------------------------- |
2 | * |
3 | * toasting.h |
4 | * This file provides some definitions to support creation of toast tables |
5 | * |
6 | * Caution: all #define's with numeric values in this file had better be |
7 | * object OIDs, else renumber_oids.pl might change them inappropriately. |
8 | * |
9 | * |
10 | * Portions Copyright (c) 1996-2019, PostgreSQL Global Development Group |
11 | * Portions Copyright (c) 1994, Regents of the University of California |
12 | * |
13 | * src/include/catalog/toasting.h |
14 | * |
15 | *------------------------------------------------------------------------- |
16 | */ |
17 | #ifndef TOASTING_H |
18 | #define TOASTING_H |
19 | |
20 | #include "storage/lock.h" |
21 | |
22 | /* |
23 | * toasting.c prototypes |
24 | */ |
25 | extern void NewRelationCreateToastTable(Oid relOid, Datum reloptions); |
26 | extern void NewHeapCreateToastTable(Oid relOid, Datum reloptions, |
27 | LOCKMODE lockmode); |
28 | extern void AlterTableCreateToastTable(Oid relOid, Datum reloptions, |
29 | LOCKMODE lockmode); |
30 | extern void BootstrapToastTable(char *relName, |
31 | Oid toastOid, Oid toastIndexOid); |
32 | |
33 | |
34 | /* |
35 | * This macro is just to keep the C compiler from spitting up on the |
36 | * upcoming commands for Catalog.pm. |
37 | */ |
38 | #define DECLARE_TOAST(name,toastoid,indexoid) extern int no_such_variable |
39 | |
40 | |
41 | /* |
42 | * What follows are lines processed by genbki.pl to create the statements |
43 | * the bootstrap parser will turn into BootstrapToastTable commands. |
44 | * Each line specifies the system catalog that needs a toast table, |
45 | * the OID to assign to the toast table, and the OID to assign to the |
46 | * toast table's index. The reason we hard-wire these OIDs is that we |
47 | * need stable OIDs for shared relations, and that includes toast tables |
48 | * of shared relations. |
49 | */ |
50 | |
51 | /* normal catalogs */ |
52 | DECLARE_TOAST(pg_aggregate, 4159, 4160); |
53 | DECLARE_TOAST(pg_attrdef, 2830, 2831); |
54 | DECLARE_TOAST(pg_collation, 4161, 4162); |
55 | DECLARE_TOAST(pg_constraint, 2832, 2833); |
56 | DECLARE_TOAST(pg_default_acl, 4143, 4144); |
57 | DECLARE_TOAST(pg_description, 2834, 2835); |
58 | DECLARE_TOAST(pg_event_trigger, 4145, 4146); |
59 | DECLARE_TOAST(pg_extension, 4147, 4148); |
60 | DECLARE_TOAST(pg_foreign_data_wrapper, 4149, 4150); |
61 | DECLARE_TOAST(pg_foreign_server, 4151, 4152); |
62 | DECLARE_TOAST(pg_foreign_table, 4153, 4154); |
63 | DECLARE_TOAST(pg_init_privs, 4155, 4156); |
64 | DECLARE_TOAST(pg_language, 4157, 4158); |
65 | DECLARE_TOAST(pg_namespace, 4163, 4164); |
66 | DECLARE_TOAST(pg_partitioned_table, 4165, 4166); |
67 | DECLARE_TOAST(pg_policy, 4167, 4168); |
68 | DECLARE_TOAST(pg_proc, 2836, 2837); |
69 | DECLARE_TOAST(pg_rewrite, 2838, 2839); |
70 | DECLARE_TOAST(pg_seclabel, 3598, 3599); |
71 | DECLARE_TOAST(pg_statistic, 2840, 2841); |
72 | DECLARE_TOAST(pg_statistic_ext, 3439, 3440); |
73 | DECLARE_TOAST(pg_statistic_ext_data, 3430, 3431); |
74 | DECLARE_TOAST(pg_trigger, 2336, 2337); |
75 | DECLARE_TOAST(pg_ts_dict, 4169, 4170); |
76 | DECLARE_TOAST(pg_type, 4171, 4172); |
77 | DECLARE_TOAST(pg_user_mapping, 4173, 4174); |
78 | |
79 | /* shared catalogs */ |
80 | DECLARE_TOAST(pg_authid, 4175, 4176); |
81 | #define PgAuthidToastTable 4175 |
82 | #define PgAuthidToastIndex 4176 |
83 | DECLARE_TOAST(pg_database, 4177, 4178); |
84 | #define PgDatabaseToastTable 4177 |
85 | #define PgDatabaseToastIndex 4178 |
86 | DECLARE_TOAST(pg_db_role_setting, 2966, 2967); |
87 | #define PgDbRoleSettingToastTable 2966 |
88 | #define PgDbRoleSettingToastIndex 2967 |
89 | DECLARE_TOAST(pg_pltemplate, 4179, 4180); |
90 | #define PgPlTemplateToastTable 4179 |
91 | #define PgPlTemplateToastIndex 4180 |
92 | DECLARE_TOAST(pg_replication_origin, 4181, 4182); |
93 | #define PgReplicationOriginToastTable 4181 |
94 | #define PgReplicationOriginToastIndex 4182 |
95 | DECLARE_TOAST(pg_shdescription, 2846, 2847); |
96 | #define PgShdescriptionToastTable 2846 |
97 | #define PgShdescriptionToastIndex 2847 |
98 | DECLARE_TOAST(pg_shseclabel, 4060, 4061); |
99 | #define PgShseclabelToastTable 4060 |
100 | #define PgShseclabelToastIndex 4061 |
101 | DECLARE_TOAST(pg_subscription, 4183, 4184); |
102 | #define PgSubscriptionToastTable 4183 |
103 | #define PgSubscriptionToastIndex 4184 |
104 | DECLARE_TOAST(pg_tablespace, 4185, 4186); |
105 | #define PgTablespaceToastTable 4185 |
106 | #define PgTablespaceToastIndex 4186 |
107 | |
108 | #endif /* TOASTING_H */ |
109 | |