PostgreSQL Source Code git master
Loading...
Searching...
No Matches
toasting.h File Reference
#include "storage/lockdefs.h"
Include dependency graph for toasting.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void NewRelationCreateToastTable (Oid relOid, Datum reloptions)
 
void NewHeapCreateToastTable (Oid relOid, Datum reloptions, LOCKMODE lockmode, Oid OIDOldToast)
 
void AlterTableCreateToastTable (Oid relOid, Datum reloptions, LOCKMODE lockmode)
 
void BootstrapToastTable (char *relName, Oid toastOid, Oid toastIndexOid)
 

Function Documentation

◆ AlterTableCreateToastTable()

void AlterTableCreateToastTable ( Oid  relOid,
Datum  reloptions,
LOCKMODE  lockmode 
)
extern

Definition at line 59 of file toasting.c.

60{
61 CheckAndCreateToastTable(relOid, reloptions, lockmode, true, InvalidOid);
62}
#define InvalidOid
static void CheckAndCreateToastTable(Oid relOid, Datum reloptions, LOCKMODE lockmode, bool check, Oid OIDOldToast)
Definition toasting.c:79

References CheckAndCreateToastTable(), and InvalidOid.

Referenced by ATRewriteCatalogs().

◆ BootstrapToastTable()

void BootstrapToastTable ( char relName,
Oid  toastOid,
Oid  toastIndexOid 
)
extern

Definition at line 99 of file toasting.c.

100{
101 Relation rel;
102
104
105 if (rel->rd_rel->relkind != RELKIND_RELATION &&
106 rel->rd_rel->relkind != RELKIND_MATVIEW)
107 elog(ERROR, "\"%s\" is not a table or materialized view",
108 relName);
109
110 /* create_toast_table does all the work */
113 elog(ERROR, "\"%s\" does not require a toast table",
114 relName);
115
116 table_close(rel, NoLock);
117}
#define ERROR
Definition elog.h:40
#define elog(elevel,...)
Definition elog.h:228
#define NoLock
Definition lockdefs.h:34
#define AccessExclusiveLock
Definition lockdefs.h:43
RangeVar * makeRangeVar(char *schemaname, char *relname, int location)
Definition makefuncs.c:473
uint64_t Datum
Definition postgres.h:70
static int fb(int x)
Form_pg_class rd_rel
Definition rel.h:111
void table_close(Relation relation, LOCKMODE lockmode)
Definition table.c:126
Relation table_openrv(const RangeVar *relation, LOCKMODE lockmode)
Definition table.c:83
static bool create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid, Datum reloptions, LOCKMODE lockmode, bool check, Oid OIDOldToast)
Definition toasting.c:128

References AccessExclusiveLock, create_toast_table(), elog, ERROR, fb(), InvalidOid, makeRangeVar(), NoLock, RelationData::rd_rel, table_close(), and table_openrv().

◆ NewHeapCreateToastTable()

void NewHeapCreateToastTable ( Oid  relOid,
Datum  reloptions,
LOCKMODE  lockmode,
Oid  OIDOldToast 
)
extern

Definition at line 65 of file toasting.c.

67{
68 CheckAndCreateToastTable(relOid, reloptions, lockmode, false, OIDOldToast);
69}

References CheckAndCreateToastTable(), and fb().

Referenced by make_new_heap().

◆ NewRelationCreateToastTable()

void NewRelationCreateToastTable ( Oid  relOid,
Datum  reloptions 
)
extern

Definition at line 72 of file toasting.c.

73{
74 CheckAndCreateToastTable(relOid, reloptions, AccessExclusiveLock, false,
76}

References AccessExclusiveLock, CheckAndCreateToastTable(), and InvalidOid.

Referenced by create_ctas_internal(), and ProcessUtilitySlow().