PostgreSQL Source Code  git master
toasting.c File Reference
#include "postgres.h"
#include "access/heapam.h"
#include "access/toast_compression.h"
#include "access/xact.h"
#include "catalog/binary_upgrade.h"
#include "catalog/catalog.h"
#include "catalog/dependency.h"
#include "catalog/heap.h"
#include "catalog/index.h"
#include "catalog/namespace.h"
#include "catalog/pg_am.h"
#include "catalog/pg_namespace.h"
#include "catalog/pg_opclass.h"
#include "catalog/pg_type.h"
#include "catalog/toasting.h"
#include "miscadmin.h"
#include "nodes/makefuncs.h"
#include "storage/lock.h"
#include "utils/builtins.h"
#include "utils/rel.h"
#include "utils/syscache.h"
Include dependency graph for toasting.c:

Go to the source code of this file.

Functions

static void CheckAndCreateToastTable (Oid relOid, Datum reloptions, LOCKMODE lockmode, bool check, Oid OIDOldToast)
 
static bool create_toast_table (Relation rel, Oid toastOid, Oid toastIndexOid, Datum reloptions, LOCKMODE lockmode, bool check, Oid OIDOldToast)
 
static bool needs_toast_table (Relation rel)
 
void AlterTableCreateToastTable (Oid relOid, Datum reloptions, LOCKMODE lockmode)
 
void NewHeapCreateToastTable (Oid relOid, Datum reloptions, LOCKMODE lockmode, Oid OIDOldToast)
 
void NewRelationCreateToastTable (Oid relOid, Datum reloptions)
 
void BootstrapToastTable (char *relName, Oid toastOid, Oid toastIndexOid)
 

Function Documentation

◆ AlterTableCreateToastTable()

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

Definition at line 60 of file toasting.c.

References CheckAndCreateToastTable(), and InvalidOid.

Referenced by ATRewriteCatalogs().

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

◆ BootstrapToastTable()

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

Definition at line 100 of file toasting.c.

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

101 {
102  Relation rel;
103 
104  rel = table_openrv(makeRangeVar(NULL, relName, -1), AccessExclusiveLock);
105 
106  if (rel->rd_rel->relkind != RELKIND_RELATION &&
107  rel->rd_rel->relkind != RELKIND_MATVIEW)
108  elog(ERROR, "\"%s\" is not a table or materialized view",
109  relName);
110 
111  /* create_toast_table does all the work */
112  if (!create_toast_table(rel, toastOid, toastIndexOid, (Datum) 0,
114  elog(ERROR, "\"%s\" does not require a toast table",
115  relName);
116 
117  table_close(rel, NoLock);
118 }
void table_close(Relation relation, LOCKMODE lockmode)
Definition: table.c:167
Form_pg_class rd_rel
Definition: rel.h:109
#define ERROR
Definition: elog.h:46
#define NoLock
Definition: lockdefs.h:34
uintptr_t Datum
Definition: postgres.h:411
static bool create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid, Datum reloptions, LOCKMODE lockmode, bool check, Oid OIDOldToast)
Definition: toasting.c:129
Relation table_openrv(const RangeVar *relation, LOCKMODE lockmode)
Definition: table.c:102
#define InvalidOid
Definition: postgres_ext.h:36
#define AccessExclusiveLock
Definition: lockdefs.h:45
#define elog(elevel,...)
Definition: elog.h:232
RangeVar * makeRangeVar(char *schemaname, char *relname, int location)
Definition: makefuncs.c:422

◆ CheckAndCreateToastTable()

static void CheckAndCreateToastTable ( Oid  relOid,
Datum  reloptions,
LOCKMODE  lockmode,
bool  check,
Oid  OIDOldToast 
)
static

Definition at line 80 of file toasting.c.

References create_toast_table(), InvalidOid, NoLock, table_close(), and table_open().

Referenced by AlterTableCreateToastTable(), NewHeapCreateToastTable(), and NewRelationCreateToastTable().

82 {
83  Relation rel;
84 
85  rel = table_open(relOid, lockmode);
86 
87  /* create_toast_table does all the work */
88  (void) create_toast_table(rel, InvalidOid, InvalidOid, reloptions, lockmode,
89  check, OIDOldToast);
90 
91  table_close(rel, NoLock);
92 }
void table_close(Relation relation, LOCKMODE lockmode)
Definition: table.c:167
#define NoLock
Definition: lockdefs.h:34
static bool create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid, Datum reloptions, LOCKMODE lockmode, bool check, Oid OIDOldToast)
Definition: toasting.c:129
#define InvalidOid
Definition: postgres_ext.h:36
Relation table_open(Oid relationId, LOCKMODE lockmode)
Definition: table.c:39

◆ create_toast_table()

static bool create_toast_table ( Relation  rel,
Oid  toastOid,
Oid  toastIndexOid,
Datum  reloptions,
LOCKMODE  lockmode,
bool  check,
Oid  OIDOldToast 
)
static

Definition at line 129 of file toasting.c.

References AccessExclusiveLock, Assert, binary_upgrade_next_toast_pg_class_oid, CatalogTupleUpdate(), ObjectAddress::classId, CommandCounterIncrement(), CreateTemplateTupleDesc(), CurrentMemoryContext, DEPENDENCY_INTERNAL, elog, ERROR, GETSTRUCT, GetTempToastNamespace(), heap_create_with_catalog(), heap_freetuple(), heap_inplace_update(), HeapTupleIsValid, IndexInfo::ii_Am, IndexInfo::ii_AmCache, IndexInfo::ii_BrokenHotChain, IndexInfo::ii_Concurrent, IndexInfo::ii_Context, IndexInfo::ii_ExclusionOps, IndexInfo::ii_ExclusionProcs, IndexInfo::ii_ExclusionStrats, IndexInfo::ii_Expressions, IndexInfo::ii_ExpressionsState, IndexInfo::ii_IndexAttrNumbers, IndexInfo::ii_NumIndexAttrs, IndexInfo::ii_NumIndexKeyAttrs, IndexInfo::ii_OpclassOptions, IndexInfo::ii_ParallelWorkers, IndexInfo::ii_Predicate, IndexInfo::ii_PredicateState, IndexInfo::ii_ReadyForInserts, IndexInfo::ii_Unique, index_create(), INDEX_CREATE_IS_PRIMARY, InvalidCompressionMethod, InvalidOid, IsBinaryUpgrade, IsBootstrapProcessingMode, isTempOrTempToastNamespace(), list_make2, makeNode, NAMEDATALEN, needs_toast_table(), NIL, NoLock, ObjectAddress::objectId, ObjectIdGetDatum, ObjectAddress::objectSubId, OidIsValid, ONCOMMIT_NOOP, RelationData::rd_rel, recordDependencyOn(), RelationGetRelid, RelationIsMapped, RELOID, RowExclusiveLock, SearchSysCacheCopy1, ShareLock, snprintf, HeapTupleData::t_self, table_close(), table_open(), table_relation_toast_am(), TupleDescAttr, and TupleDescInitEntry().

Referenced by BootstrapToastTable(), and CheckAndCreateToastTable().

132 {
133  Oid relOid = RelationGetRelid(rel);
134  HeapTuple reltup;
135  TupleDesc tupdesc;
136  bool shared_relation;
137  bool mapped_relation;
138  Relation toast_rel;
139  Relation class_rel;
140  Oid toast_relid;
141  Oid namespaceid;
142  char toast_relname[NAMEDATALEN];
143  char toast_idxname[NAMEDATALEN];
144  IndexInfo *indexInfo;
145  Oid collationObjectId[2];
146  Oid classObjectId[2];
147  int16 coloptions[2];
148  ObjectAddress baseobject,
149  toastobject;
150 
151  /*
152  * Is it already toasted?
153  */
154  if (rel->rd_rel->reltoastrelid != InvalidOid)
155  return false;
156 
157  /*
158  * Check to see whether the table actually needs a TOAST table.
159  */
160  if (!IsBinaryUpgrade)
161  {
162  /* Normal mode, normal check */
163  if (!needs_toast_table(rel))
164  return false;
165  }
166  else
167  {
168  /*
169  * In binary-upgrade mode, create a TOAST table if and only if
170  * pg_upgrade told us to (ie, a TOAST table OID has been provided).
171  *
172  * This indicates that the old cluster had a TOAST table for the
173  * current table. We must create a TOAST table to receive the old
174  * TOAST file, even if the table seems not to need one.
175  *
176  * Contrariwise, if the old cluster did not have a TOAST table, we
177  * should be able to get along without one even if the new version's
178  * needs_toast_table rules suggest we should have one. There is a lot
179  * of daylight between where we will create a TOAST table and where
180  * one is really necessary to avoid failures, so small cross-version
181  * differences in the when-to-create heuristic shouldn't be a problem.
182  * If we tried to create a TOAST table anyway, we would have the
183  * problem that it might take up an OID that will conflict with some
184  * old-cluster table we haven't seen yet.
185  */
187  return false;
188  }
189 
190  /*
191  * If requested check lockmode is sufficient. This is a cross check in
192  * case of errors or conflicting decisions in earlier code.
193  */
194  if (check && lockmode != AccessExclusiveLock)
195  elog(ERROR, "AccessExclusiveLock required to add toast table.");
196 
197  /*
198  * Create the toast table and its index
199  */
200  snprintf(toast_relname, sizeof(toast_relname),
201  "pg_toast_%u", relOid);
202  snprintf(toast_idxname, sizeof(toast_idxname),
203  "pg_toast_%u_index", relOid);
204 
205  /* this is pretty painful... need a tuple descriptor */
206  tupdesc = CreateTemplateTupleDesc(3);
207  TupleDescInitEntry(tupdesc, (AttrNumber) 1,
208  "chunk_id",
209  OIDOID,
210  -1, 0);
211  TupleDescInitEntry(tupdesc, (AttrNumber) 2,
212  "chunk_seq",
213  INT4OID,
214  -1, 0);
215  TupleDescInitEntry(tupdesc, (AttrNumber) 3,
216  "chunk_data",
217  BYTEAOID,
218  -1, 0);
219 
220  /*
221  * Ensure that the toast table doesn't itself get toasted, or we'll be
222  * toast :-(. This is essential for chunk_data because type bytea is
223  * toastable; hit the other two just to be sure.
224  */
225  TupleDescAttr(tupdesc, 0)->attstorage = TYPSTORAGE_PLAIN;
226  TupleDescAttr(tupdesc, 1)->attstorage = TYPSTORAGE_PLAIN;
227  TupleDescAttr(tupdesc, 2)->attstorage = TYPSTORAGE_PLAIN;
228 
229  /* Toast field should not be compressed */
230  TupleDescAttr(tupdesc, 0)->attcompression = InvalidCompressionMethod;
231  TupleDescAttr(tupdesc, 1)->attcompression = InvalidCompressionMethod;
232  TupleDescAttr(tupdesc, 2)->attcompression = InvalidCompressionMethod;
233 
234  /*
235  * Toast tables for regular relations go in pg_toast; those for temp
236  * relations go into the per-backend temp-toast-table namespace.
237  */
238  if (isTempOrTempToastNamespace(rel->rd_rel->relnamespace))
239  namespaceid = GetTempToastNamespace();
240  else
241  namespaceid = PG_TOAST_NAMESPACE;
242 
243  /* Toast table is shared if and only if its parent is. */
244  shared_relation = rel->rd_rel->relisshared;
245 
246  /* It's mapped if and only if its parent is, too */
247  mapped_relation = RelationIsMapped(rel);
248 
249  toast_relid = heap_create_with_catalog(toast_relname,
250  namespaceid,
251  rel->rd_rel->reltablespace,
252  toastOid,
253  InvalidOid,
254  InvalidOid,
255  rel->rd_rel->relowner,
257  tupdesc,
258  NIL,
259  RELKIND_TOASTVALUE,
260  rel->rd_rel->relpersistence,
261  shared_relation,
262  mapped_relation,
264  reloptions,
265  false,
266  true,
267  true,
268  OIDOldToast,
269  NULL);
270  Assert(toast_relid != InvalidOid);
271 
272  /* make the toast relation visible, else table_open will fail */
274 
275  /* ShareLock is not really needed here, but take it anyway */
276  toast_rel = table_open(toast_relid, ShareLock);
277 
278  /*
279  * Create unique index on chunk_id, chunk_seq.
280  *
281  * NOTE: the normal TOAST access routines could actually function with a
282  * single-column index on chunk_id only. However, the slice access
283  * routines use both columns for faster access to an individual chunk. In
284  * addition, we want it to be unique as a check against the possibility of
285  * duplicate TOAST chunk OIDs. The index might also be a little more
286  * efficient this way, since btree isn't all that happy with large numbers
287  * of equal keys.
288  */
289 
290  indexInfo = makeNode(IndexInfo);
291  indexInfo->ii_NumIndexAttrs = 2;
292  indexInfo->ii_NumIndexKeyAttrs = 2;
293  indexInfo->ii_IndexAttrNumbers[0] = 1;
294  indexInfo->ii_IndexAttrNumbers[1] = 2;
295  indexInfo->ii_Expressions = NIL;
296  indexInfo->ii_ExpressionsState = NIL;
297  indexInfo->ii_Predicate = NIL;
298  indexInfo->ii_PredicateState = NULL;
299  indexInfo->ii_ExclusionOps = NULL;
300  indexInfo->ii_ExclusionProcs = NULL;
301  indexInfo->ii_ExclusionStrats = NULL;
302  indexInfo->ii_OpclassOptions = NULL;
303  indexInfo->ii_Unique = true;
304  indexInfo->ii_ReadyForInserts = true;
305  indexInfo->ii_Concurrent = false;
306  indexInfo->ii_BrokenHotChain = false;
307  indexInfo->ii_ParallelWorkers = 0;
308  indexInfo->ii_Am = BTREE_AM_OID;
309  indexInfo->ii_AmCache = NULL;
310  indexInfo->ii_Context = CurrentMemoryContext;
311 
312  collationObjectId[0] = InvalidOid;
313  collationObjectId[1] = InvalidOid;
314 
315  classObjectId[0] = OID_BTREE_OPS_OID;
316  classObjectId[1] = INT4_BTREE_OPS_OID;
317 
318  coloptions[0] = 0;
319  coloptions[1] = 0;
320 
321  index_create(toast_rel, toast_idxname, toastIndexOid, InvalidOid,
323  indexInfo,
324  list_make2("chunk_id", "chunk_seq"),
325  BTREE_AM_OID,
326  rel->rd_rel->reltablespace,
327  collationObjectId, classObjectId, coloptions, (Datum) 0,
328  INDEX_CREATE_IS_PRIMARY, 0, true, true, NULL);
329 
330  table_close(toast_rel, NoLock);
331 
332  /*
333  * Store the toast table's OID in the parent relation's pg_class row
334  */
335  class_rel = table_open(RelationRelationId, RowExclusiveLock);
336 
337  reltup = SearchSysCacheCopy1(RELOID, ObjectIdGetDatum(relOid));
338  if (!HeapTupleIsValid(reltup))
339  elog(ERROR, "cache lookup failed for relation %u", relOid);
340 
341  ((Form_pg_class) GETSTRUCT(reltup))->reltoastrelid = toast_relid;
342 
344  {
345  /* normal case, use a transactional update */
346  CatalogTupleUpdate(class_rel, &reltup->t_self, reltup);
347  }
348  else
349  {
350  /* While bootstrapping, we cannot UPDATE, so overwrite in-place */
351  heap_inplace_update(class_rel, reltup);
352  }
353 
354  heap_freetuple(reltup);
355 
356  table_close(class_rel, RowExclusiveLock);
357 
358  /*
359  * Register dependency from the toast table to the main, so that the toast
360  * table will be deleted if the main is. Skip this in bootstrap mode.
361  */
363  {
364  baseobject.classId = RelationRelationId;
365  baseobject.objectId = relOid;
366  baseobject.objectSubId = 0;
367  toastobject.classId = RelationRelationId;
368  toastobject.objectId = toast_relid;
369  toastobject.objectSubId = 0;
370 
371  recordDependencyOn(&toastobject, &baseobject, DEPENDENCY_INTERNAL);
372  }
373 
374  /*
375  * Make changes visible
376  */
378 
379  return true;
380 }
#define list_make2(x1, x2)
Definition: pg_list.h:208
signed short int16
Definition: c.h:428
#define NIL
Definition: pg_list.h:65
MemoryContext ii_Context
Definition: execnodes.h:180
void table_close(Relation relation, LOCKMODE lockmode)
Definition: table.c:167
#define GETSTRUCT(TUP)
Definition: htup_details.h:654
List * ii_Predicate
Definition: execnodes.h:164
TupleDesc CreateTemplateTupleDesc(int natts)
Definition: tupdesc.c:45
Oid binary_upgrade_next_toast_pg_class_oid
Definition: heap.c:94
bool isTempOrTempToastNamespace(Oid namespaceId)
Definition: namespace.c:3226
#define TupleDescAttr(tupdesc, i)
Definition: tupdesc.h:92
ExprState * ii_PredicateState
Definition: execnodes.h:165
Oid * ii_ExclusionProcs
Definition: execnodes.h:167
void recordDependencyOn(const ObjectAddress *depender, const ObjectAddress *referenced, DependencyType behavior)
Definition: pg_depend.c:44
Form_pg_class rd_rel
Definition: rel.h:109
void heap_freetuple(HeapTuple htup)
Definition: heaptuple.c:1338
unsigned int Oid
Definition: postgres_ext.h:31
Oid index_create(Relation heapRelation, const char *indexRelationName, Oid indexRelationId, Oid parentIndexRelid, Oid parentConstraintId, Oid relFileNode, IndexInfo *indexInfo, List *indexColNames, Oid accessMethodObjectId, Oid tableSpaceId, Oid *collationObjectId, Oid *classObjectId, int16 *coloptions, Datum reloptions, bits16 flags, bits16 constr_flags, bool allow_system_table_mods, bool is_internal, Oid *constraintId)
Definition: index.c:698
#define OidIsValid(objectId)
Definition: c.h:710
bool IsBinaryUpgrade
Definition: globals.c:113
#define NAMEDATALEN
List * ii_ExpressionsState
Definition: execnodes.h:163
#define ObjectIdGetDatum(X)
Definition: postgres.h:551
#define ERROR
Definition: elog.h:46
int ii_NumIndexKeyAttrs
Definition: execnodes.h:160
ItemPointerData t_self
Definition: htup.h:65
Oid GetTempToastNamespace(void)
Definition: namespace.c:3344
#define NoLock
Definition: lockdefs.h:34
static bool needs_toast_table(Relation rel)
Definition: toasting.c:386
#define RowExclusiveLock
Definition: lockdefs.h:38
bool ii_BrokenHotChain
Definition: execnodes.h:176
MemoryContext CurrentMemoryContext
Definition: mcxt.c:42
void TupleDescInitEntry(TupleDesc desc, AttrNumber attributeNumber, const char *attributeName, Oid oidtypeid, int32 typmod, int attdim)
Definition: tupdesc.c:583
bool ii_ReadyForInserts
Definition: execnodes.h:174
void * ii_AmCache
Definition: execnodes.h:179
#define RelationIsMapped(relation)
Definition: rel.h:526
uintptr_t Datum
Definition: postgres.h:411
void CommandCounterIncrement(void)
Definition: xact.c:1022
int ii_NumIndexAttrs
Definition: execnodes.h:159
#define INDEX_CREATE_IS_PRIMARY
Definition: index.h:61
#define InvalidOid
Definition: postgres_ext.h:36
bool ii_Unique
Definition: execnodes.h:173
#define makeNode(_type_)
Definition: nodes.h:586
#define HeapTupleIsValid(tuple)
Definition: htup.h:78
List * ii_Expressions
Definition: execnodes.h:162
#define Assert(condition)
Definition: c.h:804
Oid heap_create_with_catalog(const char *relname, Oid relnamespace, Oid reltablespace, Oid relid, Oid reltypeid, Oid reloftypeid, Oid ownerid, Oid accessmtd, TupleDesc tupdesc, List *cooked_constraints, char relkind, char relpersistence, bool shared_relation, bool mapped_relation, OnCommitAction oncommit, Datum reloptions, bool use_user_acl, bool allow_system_table_mods, bool is_internal, Oid relrewrite, ObjectAddress *typaddress)
Definition: heap.c:1146
int ii_ParallelWorkers
Definition: execnodes.h:177
void CatalogTupleUpdate(Relation heapRel, ItemPointer otid, HeapTuple tup)
Definition: indexing.c:301
bool ii_Concurrent
Definition: execnodes.h:175
#define IsBootstrapProcessingMode()
Definition: miscadmin.h:406
FormData_pg_class * Form_pg_class
Definition: pg_class.h:153
#define SearchSysCacheCopy1(cacheId, key1)
Definition: syscache.h:177
#define AccessExclusiveLock
Definition: lockdefs.h:45
#define InvalidCompressionMethod
Oid * ii_ExclusionOps
Definition: execnodes.h:166
void heap_inplace_update(Relation relation, HeapTuple tuple)
Definition: heapam.c:5991
#define elog(elevel,...)
Definition: elog.h:232
#define ShareLock
Definition: lockdefs.h:41
static Oid table_relation_toast_am(Relation rel)
Definition: tableam.h:1857
AttrNumber ii_IndexAttrNumbers[INDEX_MAX_KEYS]
Definition: execnodes.h:161
uint16 * ii_ExclusionStrats
Definition: execnodes.h:168
Relation table_open(Oid relationId, LOCKMODE lockmode)
Definition: table.c:39
#define snprintf
Definition: port.h:217
int16 AttrNumber
Definition: attnum.h:21
#define RelationGetRelid(relation)
Definition: rel.h:477
Datum * ii_OpclassOptions
Definition: execnodes.h:172
Oid ii_Am
Definition: execnodes.h:178

◆ needs_toast_table()

static bool needs_toast_table ( Relation  rel)
static

Definition at line 386 of file toasting.c.

References IsBootstrapProcessingMode, IsCatalogRelation(), RelationData::rd_rel, and table_relation_needs_toast_table().

Referenced by create_toast_table().

387 {
388  /*
389  * No need to create a TOAST table for partitioned tables.
390  */
391  if (rel->rd_rel->relkind == RELKIND_PARTITIONED_TABLE)
392  return false;
393 
394  /*
395  * We cannot allow toasting a shared relation after initdb (because
396  * there's no way to mark it toasted in other databases' pg_class).
397  */
398  if (rel->rd_rel->relisshared && !IsBootstrapProcessingMode())
399  return false;
400 
401  /*
402  * Ignore attempts to create toast tables on catalog tables after initdb.
403  * Which catalogs get toast tables is explicitly chosen in catalog/pg_*.h.
404  * (We could get here via some ALTER TABLE command if the catalog doesn't
405  * have a toast table.)
406  */
408  return false;
409 
410  /* Otherwise, let the AM decide. */
412 }
bool IsCatalogRelation(Relation relation)
Definition: catalog.c:104
Form_pg_class rd_rel
Definition: rel.h:109
#define IsBootstrapProcessingMode()
Definition: miscadmin.h:406
static bool table_relation_needs_toast_table(Relation rel)
Definition: tableam.h:1847

◆ NewHeapCreateToastTable()

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

Definition at line 66 of file toasting.c.

References CheckAndCreateToastTable().

Referenced by make_new_heap().

68 {
69  CheckAndCreateToastTable(relOid, reloptions, lockmode, false, OIDOldToast);
70 }
static void CheckAndCreateToastTable(Oid relOid, Datum reloptions, LOCKMODE lockmode, bool check, Oid OIDOldToast)
Definition: toasting.c:80

◆ NewRelationCreateToastTable()

void NewRelationCreateToastTable ( Oid  relOid,
Datum  reloptions 
)

Definition at line 73 of file toasting.c.

References AccessExclusiveLock, CheckAndCreateToastTable(), and InvalidOid.

Referenced by create_ctas_internal(), and ProcessUtilitySlow().

74 {
75  CheckAndCreateToastTable(relOid, reloptions, AccessExclusiveLock, false,
76  InvalidOid);
77 }
static void CheckAndCreateToastTable(Oid relOid, Datum reloptions, LOCKMODE lockmode, bool check, Oid OIDOldToast)
Definition: toasting.c:80
#define InvalidOid
Definition: postgres_ext.h:36
#define AccessExclusiveLock
Definition: lockdefs.h:45