PostgreSQL Source Code  git master
rel.h
Go to the documentation of this file.
1 /*-------------------------------------------------------------------------
2  *
3  * rel.h
4  * POSTGRES relation descriptor (a/k/a relcache entry) definitions.
5  *
6  *
7  * Portions Copyright (c) 1996-2020, PostgreSQL Global Development Group
8  * Portions Copyright (c) 1994, Regents of the University of California
9  *
10  * src/include/utils/rel.h
11  *
12  *-------------------------------------------------------------------------
13  */
14 #ifndef REL_H
15 #define REL_H
16 
17 #include "access/tupdesc.h"
18 #include "access/xlog.h"
19 #include "catalog/pg_class.h"
20 #include "catalog/pg_index.h"
21 #include "catalog/pg_publication.h"
22 #include "nodes/bitmapset.h"
23 #include "partitioning/partdefs.h"
24 #include "rewrite/prs2lock.h"
25 #include "storage/block.h"
26 #include "storage/relfilenode.h"
27 #include "utils/relcache.h"
28 #include "utils/reltrigger.h"
29 
30 
31 /*
32  * LockRelId and LockInfo really belong to lmgr.h, but it's more convenient
33  * to declare them here so we can have a LockInfoData field in a Relation.
34  */
35 
36 typedef struct LockRelId
37 {
38  Oid relId; /* a relation identifier */
39  Oid dbId; /* a database identifier */
40 } LockRelId;
41 
42 typedef struct LockInfoData
43 {
45 } LockInfoData;
46 
48 
49 /*
50  * Here are the contents of a relation cache entry.
51  */
52 
53 typedef struct RelationData
54 {
55  RelFileNode rd_node; /* relation physical identifier */
56  /* use "struct" here to avoid needing to include smgr.h: */
57  struct SMgrRelationData *rd_smgr; /* cached file handle, or NULL */
58  int rd_refcnt; /* reference count */
59  BackendId rd_backend; /* owning backend id, if temporary relation */
60  bool rd_islocaltemp; /* rel is a temp rel of this session */
61  bool rd_isnailed; /* rel is nailed in cache */
62  bool rd_isvalid; /* relcache entry is valid */
63  bool rd_indexvalid; /* is rd_indexlist valid? (also rd_pkindex and
64  * rd_replidindex) */
65  bool rd_statvalid; /* is rd_statlist valid? */
66 
67  /*
68  * rd_createSubid is the ID of the highest subtransaction the rel has
69  * survived into; or zero if the rel was not created in the current top
70  * transaction. This can be now be relied on, whereas previously it could
71  * be "forgotten" in earlier releases. Likewise, rd_newRelfilenodeSubid is
72  * the ID of the highest subtransaction the relfilenode change has
73  * survived into, or zero if not changed in the current transaction (or we
74  * have forgotten changing it). rd_newRelfilenodeSubid can be forgotten
75  * when a relation has multiple new relfilenodes within a single
76  * transaction, with one of them occurring in a subsequently aborted
77  * subtransaction, e.g. BEGIN; TRUNCATE t; SAVEPOINT save; TRUNCATE t;
78  * ROLLBACK TO save; -- rd_newRelfilenodeSubid is now forgotten
79  */
80  SubTransactionId rd_createSubid; /* rel was created in current xact */
81  SubTransactionId rd_newRelfilenodeSubid; /* new relfilenode assigned in
82  * current xact */
83 
84  Form_pg_class rd_rel; /* RELATION tuple */
85  TupleDesc rd_att; /* tuple descriptor */
86  Oid rd_id; /* relation's object id */
87  LockInfoData rd_lockInfo; /* lock mgr's info for locking relation */
88  RuleLock *rd_rules; /* rewrite rules */
89  MemoryContext rd_rulescxt; /* private memory cxt for rd_rules, if any */
90  TriggerDesc *trigdesc; /* Trigger info, or NULL if rel has none */
91  /* use "struct" here to avoid needing to include rowsecurity.h: */
92  struct RowSecurityDesc *rd_rsdesc; /* row security policies, or NULL */
93 
94  /* data managed by RelationGetFKeyList: */
95  List *rd_fkeylist; /* list of ForeignKeyCacheInfo (see below) */
96  bool rd_fkeyvalid; /* true if list has been computed */
97 
98  /* data managed by RelationGetPartitionKey: */
99  PartitionKey rd_partkey; /* partition key, or NULL */
100  MemoryContext rd_partkeycxt; /* private context for rd_partkey, if any */
101 
102  /* data managed by RelationGetPartitionDesc: */
103  PartitionDesc rd_partdesc; /* partition descriptor, or NULL */
104  MemoryContext rd_pdcxt; /* private context for rd_partdesc, if any */
105 
106  /* data managed by RelationGetPartitionQual: */
107  List *rd_partcheck; /* partition CHECK quals */
108  bool rd_partcheckvalid; /* true if list has been computed */
109  MemoryContext rd_partcheckcxt; /* private cxt for rd_partcheck, if any */
110 
111  /* data managed by RelationGetIndexList: */
112  List *rd_indexlist; /* list of OIDs of indexes on relation */
113  Oid rd_pkindex; /* OID of primary key, if any */
114  Oid rd_replidindex; /* OID of replica identity index, if any */
115 
116  /* data managed by RelationGetStatExtList: */
117  List *rd_statlist; /* list of OIDs of extended stats */
118 
119  /* data managed by RelationGetIndexAttrBitmap: */
120  Bitmapset *rd_indexattr; /* identifies columns used in indexes */
121  Bitmapset *rd_keyattr; /* cols that can be ref'd by foreign keys */
122  Bitmapset *rd_pkattr; /* cols included in primary key */
123  Bitmapset *rd_idattr; /* included in replica identity index */
124 
125  PublicationActions *rd_pubactions; /* publication actions */
126 
127  /*
128  * rd_options is set whenever rd_rel is loaded into the relcache entry.
129  * Note that you can NOT look into rd_rel for this data. NULL means "use
130  * defaults".
131  */
132  bytea *rd_options; /* parsed pg_class.reloptions */
133 
134  /*
135  * Oid of the handler for this relation. For an index this is a function
136  * returning IndexAmRoutine, for table like relations a function returning
137  * TableAmRoutine. This is stored separately from rd_indam, rd_tableam as
138  * its lookup requires syscache access, but during relcache bootstrap we
139  * need to be able to initialize rd_tableam without syscache lookups.
140  */
141  Oid rd_amhandler; /* OID of index AM's handler function */
142 
143  /*
144  * Table access method.
145  */
146  const struct TableAmRoutine *rd_tableam;
147 
148  /* These are non-NULL only for an index relation: */
149  Form_pg_index rd_index; /* pg_index tuple describing this index */
150  /* use "struct" here to avoid needing to include htup.h: */
151  struct HeapTupleData *rd_indextuple; /* all of pg_index tuple */
152 
153  /*
154  * index access support info (used only for an index relation)
155  *
156  * Note: only default support procs for each opclass are cached, namely
157  * those with lefttype and righttype equal to the opclass's opcintype. The
158  * arrays are indexed by support function number, which is a sufficient
159  * identifier given that restriction.
160  */
161  MemoryContext rd_indexcxt; /* private memory cxt for this stuff */
162  /* use "struct" here to avoid needing to include amapi.h: */
163  struct IndexAmRoutine *rd_indam; /* index AM's API struct */
164  Oid *rd_opfamily; /* OIDs of op families for each index col */
165  Oid *rd_opcintype; /* OIDs of opclass declared input data types */
166  RegProcedure *rd_support; /* OIDs of support procedures */
167  struct FmgrInfo *rd_supportinfo; /* lookup info for support procedures */
168  int16 *rd_indoption; /* per-column AM-specific flags */
169  List *rd_indexprs; /* index expression trees, if any */
170  List *rd_indpred; /* index predicate tree, if any */
171  Oid *rd_exclops; /* OIDs of exclusion operators, if any */
172  Oid *rd_exclprocs; /* OIDs of exclusion ops' procs, if any */
173  uint16 *rd_exclstrats; /* exclusion ops' strategy numbers, if any */
174  Oid *rd_indcollation; /* OIDs of index collations */
175 
176  /*
177  * rd_amcache is available for index and table AMs to cache private data
178  * about the relation. This must be just a cache since it may get reset
179  * at any time (in particular, it will get reset by a relcache inval
180  * message for the relation). If used, it must point to a single memory
181  * chunk palloc'd in CacheMemoryContext, or in rd_indexcxt for an index
182  * relation. A relcache reset will include freeing that chunk and setting
183  * rd_amcache = NULL.
184  */
185  void *rd_amcache; /* available for use by index/table AM */
186 
187  /*
188  * foreign-table support
189  *
190  * rd_fdwroutine must point to a single memory chunk palloc'd in
191  * CacheMemoryContext. It will be freed and reset to NULL on a relcache
192  * reset.
193  */
194 
195  /* use "struct" here to avoid needing to include fdwapi.h: */
196  struct FdwRoutine *rd_fdwroutine; /* cached function pointers, or NULL */
197 
198  /*
199  * Hack for CLUSTER, rewriting ALTER TABLE, etc: when writing a new
200  * version of a table, we need to make any toast pointers inserted into it
201  * have the existing toast table's OID, not the OID of the transient toast
202  * table. If rd_toastoid isn't InvalidOid, it is the OID to place in
203  * toast pointers inserted into this rel. (Note it's set on the new
204  * version of the main heap, not the toast table itself.) This also
205  * causes toast_save_datum() to try to preserve toast value OIDs.
206  */
207  Oid rd_toastoid; /* Real TOAST table's OID, or InvalidOid */
208 
209  /* use "struct" here to avoid needing to include pgstat.h: */
210  struct PgStat_TableStatus *pgstat_info; /* statistics collection area */
211 } RelationData;
212 
213 
214 /*
215  * ForeignKeyCacheInfo
216  * Information the relcache can cache about foreign key constraints
217  *
218  * This is basically just an image of relevant columns from pg_constraint.
219  * We make it a subclass of Node so that copyObject() can be used on a list
220  * of these, but we also ensure it is a "flat" object without substructure,
221  * so that list_free_deep() is sufficient to free such a list.
222  * The per-FK-column arrays can be fixed-size because we allow at most
223  * INDEX_MAX_KEYS columns in a foreign key constraint.
224  *
225  * Currently, we mostly cache fields of interest to the planner, but the set
226  * of fields has already grown the constraint OID for other uses.
227  */
228 typedef struct ForeignKeyCacheInfo
229 {
231  Oid conoid; /* oid of the constraint itself */
232  Oid conrelid; /* relation constrained by the foreign key */
233  Oid confrelid; /* relation referenced by the foreign key */
234  int nkeys; /* number of columns in the foreign key */
235  /* these arrays each have nkeys valid entries: */
236  AttrNumber conkey[INDEX_MAX_KEYS]; /* cols in referencing table */
237  AttrNumber confkey[INDEX_MAX_KEYS]; /* cols in referenced table */
238  Oid conpfeqop[INDEX_MAX_KEYS]; /* PK = FK operator OIDs */
240 
241 
242 /*
243  * StdRdOptions
244  * Standard contents of rd_options for heaps.
245  *
246  * RelationGetFillFactor() and RelationGetTargetPageFreeSpace() can only
247  * be applied to relations that use this format or a superset for
248  * private options data.
249  */
250  /* autovacuum-related reloptions. */
251 typedef struct AutoVacOpts
252 {
253  bool enabled;
267 } AutoVacOpts;
268 
269 typedef struct StdRdOptions
270 {
271  int32 vl_len_; /* varlena header (do not touch directly!) */
272  int fillfactor; /* page fill factor in percent (0..100) */
273  /* fraction of newly inserted tuples prior to trigger index cleanup */
274  int toast_tuple_target; /* target for tuple toasting */
275  AutoVacOpts autovacuum; /* autovacuum-related options */
276  bool user_catalog_table; /* use as an additional catalog relation */
277  int parallel_workers; /* max number of parallel workers */
278  bool vacuum_index_cleanup; /* enables index vacuuming and cleanup */
279  bool vacuum_truncate; /* enables vacuum to truncate a relation */
280 } StdRdOptions;
281 
282 #define HEAP_MIN_FILLFACTOR 10
283 #define HEAP_DEFAULT_FILLFACTOR 100
284 
285 /*
286  * RelationGetToastTupleTarget
287  * Returns the relation's toast_tuple_target. Note multiple eval of argument!
288  */
289 #define RelationGetToastTupleTarget(relation, defaulttarg) \
290  ((relation)->rd_options ? \
291  ((StdRdOptions *) (relation)->rd_options)->toast_tuple_target : (defaulttarg))
292 
293 /*
294  * RelationGetFillFactor
295  * Returns the relation's fillfactor. Note multiple eval of argument!
296  */
297 #define RelationGetFillFactor(relation, defaultff) \
298  ((relation)->rd_options ? \
299  ((StdRdOptions *) (relation)->rd_options)->fillfactor : (defaultff))
300 
301 /*
302  * RelationGetTargetPageUsage
303  * Returns the relation's desired space usage per page in bytes.
304  */
305 #define RelationGetTargetPageUsage(relation, defaultff) \
306  (BLCKSZ * RelationGetFillFactor(relation, defaultff) / 100)
307 
308 /*
309  * RelationGetTargetPageFreeSpace
310  * Returns the relation's desired freespace per page in bytes.
311  */
312 #define RelationGetTargetPageFreeSpace(relation, defaultff) \
313  (BLCKSZ * (100 - RelationGetFillFactor(relation, defaultff)) / 100)
314 
315 /*
316  * RelationIsUsedAsCatalogTable
317  * Returns whether the relation should be treated as a catalog table
318  * from the pov of logical decoding. Note multiple eval of argument!
319  */
320 #define RelationIsUsedAsCatalogTable(relation) \
321  ((relation)->rd_options && \
322  ((relation)->rd_rel->relkind == RELKIND_RELATION || \
323  (relation)->rd_rel->relkind == RELKIND_MATVIEW) ? \
324  ((StdRdOptions *) (relation)->rd_options)->user_catalog_table : false)
325 
326 /*
327  * RelationGetParallelWorkers
328  * Returns the relation's parallel_workers reloption setting.
329  * Note multiple eval of argument!
330  */
331 #define RelationGetParallelWorkers(relation, defaultpw) \
332  ((relation)->rd_options ? \
333  ((StdRdOptions *) (relation)->rd_options)->parallel_workers : (defaultpw))
334 
335 /* ViewOptions->check_option values */
336 typedef enum ViewOptCheckOption
337 {
342 
343 /*
344  * ViewOptions
345  * Contents of rd_options for views
346  */
347 typedef struct ViewOptions
348 {
349  int32 vl_len_; /* varlena header (do not touch directly!) */
352 } ViewOptions;
353 
354 /*
355  * RelationIsSecurityView
356  * Returns whether the relation is security view, or not. Note multiple
357  * eval of argument!
358  */
359 #define RelationIsSecurityView(relation) \
360  (AssertMacro(relation->rd_rel->relkind == RELKIND_VIEW), \
361  (relation)->rd_options ? \
362  ((ViewOptions *) (relation)->rd_options)->security_barrier : false)
363 
364 /*
365  * RelationHasCheckOption
366  * Returns true if the relation is a view defined with either the local
367  * or the cascaded check option. Note multiple eval of argument!
368  */
369 #define RelationHasCheckOption(relation) \
370  (AssertMacro(relation->rd_rel->relkind == RELKIND_VIEW), \
371  (relation)->rd_options && \
372  ((ViewOptions *) (relation)->rd_options)->check_option != \
373  VIEW_OPTION_CHECK_OPTION_NOT_SET)
374 
375 /*
376  * RelationHasLocalCheckOption
377  * Returns true if the relation is a view defined with the local check
378  * option. Note multiple eval of argument!
379  */
380 #define RelationHasLocalCheckOption(relation) \
381  (AssertMacro(relation->rd_rel->relkind == RELKIND_VIEW), \
382  (relation)->rd_options && \
383  ((ViewOptions *) (relation)->rd_options)->check_option == \
384  VIEW_OPTION_CHECK_OPTION_LOCAL)
385 
386 /*
387  * RelationHasCascadedCheckOption
388  * Returns true if the relation is a view defined with the cascaded check
389  * option. Note multiple eval of argument!
390  */
391 #define RelationHasCascadedCheckOption(relation) \
392  (AssertMacro(relation->rd_rel->relkind == RELKIND_VIEW), \
393  (relation)->rd_options && \
394  ((ViewOptions *) (relation)->rd_options)->check_option == \
395  VIEW_OPTION_CHECK_OPTION_CASCADED)
396 
397 /*
398  * RelationIsValid
399  * True iff relation descriptor is valid.
400  */
401 #define RelationIsValid(relation) PointerIsValid(relation)
402 
403 #define InvalidRelation ((Relation) NULL)
404 
405 /*
406  * RelationHasReferenceCountZero
407  * True iff relation reference count is zero.
408  *
409  * Note:
410  * Assumes relation descriptor is valid.
411  */
412 #define RelationHasReferenceCountZero(relation) \
413  ((bool)((relation)->rd_refcnt == 0))
414 
415 /*
416  * RelationGetForm
417  * Returns pg_class tuple for a relation.
418  *
419  * Note:
420  * Assumes relation descriptor is valid.
421  */
422 #define RelationGetForm(relation) ((relation)->rd_rel)
423 
424 /*
425  * RelationGetRelid
426  * Returns the OID of the relation
427  */
428 #define RelationGetRelid(relation) ((relation)->rd_id)
429 
430 /*
431  * RelationGetNumberOfAttributes
432  * Returns the total number of attributes in a relation.
433  */
434 #define RelationGetNumberOfAttributes(relation) ((relation)->rd_rel->relnatts)
435 
436 /*
437  * IndexRelationGetNumberOfAttributes
438  * Returns the number of attributes in an index.
439  */
440 #define IndexRelationGetNumberOfAttributes(relation) \
441  ((relation)->rd_index->indnatts)
442 
443 /*
444  * IndexRelationGetNumberOfKeyAttributes
445  * Returns the number of key attributes in an index.
446  */
447 #define IndexRelationGetNumberOfKeyAttributes(relation) \
448  ((relation)->rd_index->indnkeyatts)
449 
450 /*
451  * RelationGetDescr
452  * Returns tuple descriptor for a relation.
453  */
454 #define RelationGetDescr(relation) ((relation)->rd_att)
455 
456 /*
457  * RelationGetRelationName
458  * Returns the rel's name.
459  *
460  * Note that the name is only unique within the containing namespace.
461  */
462 #define RelationGetRelationName(relation) \
463  (NameStr((relation)->rd_rel->relname))
464 
465 /*
466  * RelationGetNamespace
467  * Returns the rel's namespace OID.
468  */
469 #define RelationGetNamespace(relation) \
470  ((relation)->rd_rel->relnamespace)
471 
472 /*
473  * RelationIsMapped
474  * True if the relation uses the relfilenode map. Note multiple eval
475  * of argument!
476  */
477 #define RelationIsMapped(relation) \
478  (RELKIND_HAS_STORAGE((relation)->rd_rel->relkind) && \
479  ((relation)->rd_rel->relfilenode == InvalidOid))
480 
481 /*
482  * RelationOpenSmgr
483  * Open the relation at the smgr level, if not already done.
484  */
485 #define RelationOpenSmgr(relation) \
486  do { \
487  if ((relation)->rd_smgr == NULL) \
488  smgrsetowner(&((relation)->rd_smgr), smgropen((relation)->rd_node, (relation)->rd_backend)); \
489  } while (0)
490 
491 /*
492  * RelationCloseSmgr
493  * Close the relation at the smgr level, if not already done.
494  *
495  * Note: smgrclose should unhook from owner pointer, hence the Assert.
496  */
497 #define RelationCloseSmgr(relation) \
498  do { \
499  if ((relation)->rd_smgr != NULL) \
500  { \
501  smgrclose((relation)->rd_smgr); \
502  Assert((relation)->rd_smgr == NULL); \
503  } \
504  } while (0)
505 
506 /*
507  * RelationGetTargetBlock
508  * Fetch relation's current insertion target block.
509  *
510  * Returns InvalidBlockNumber if there is no current target block. Note
511  * that the target block status is discarded on any smgr-level invalidation.
512  */
513 #define RelationGetTargetBlock(relation) \
514  ( (relation)->rd_smgr != NULL ? (relation)->rd_smgr->smgr_targblock : InvalidBlockNumber )
515 
516 /*
517  * RelationSetTargetBlock
518  * Set relation's current insertion target block.
519  */
520 #define RelationSetTargetBlock(relation, targblock) \
521  do { \
522  RelationOpenSmgr(relation); \
523  (relation)->rd_smgr->smgr_targblock = (targblock); \
524  } while (0)
525 
526 /*
527  * RelationNeedsWAL
528  * True if relation needs WAL.
529  */
530 #define RelationNeedsWAL(relation) \
531  ((relation)->rd_rel->relpersistence == RELPERSISTENCE_PERMANENT)
532 
533 /*
534  * RelationUsesLocalBuffers
535  * True if relation's pages are stored in local buffers.
536  */
537 #define RelationUsesLocalBuffers(relation) \
538  ((relation)->rd_rel->relpersistence == RELPERSISTENCE_TEMP)
539 
540 /*
541  * RELATION_IS_LOCAL
542  * If a rel is either temp or newly created in the current transaction,
543  * it can be assumed to be accessible only to the current backend.
544  * This is typically used to decide that we can skip acquiring locks.
545  *
546  * Beware of multiple eval of argument
547  */
548 #define RELATION_IS_LOCAL(relation) \
549  ((relation)->rd_islocaltemp || \
550  (relation)->rd_createSubid != InvalidSubTransactionId)
551 
552 /*
553  * RELATION_IS_OTHER_TEMP
554  * Test for a temporary relation that belongs to some other session.
555  *
556  * Beware of multiple eval of argument
557  */
558 #define RELATION_IS_OTHER_TEMP(relation) \
559  ((relation)->rd_rel->relpersistence == RELPERSISTENCE_TEMP && \
560  !(relation)->rd_islocaltemp)
561 
562 
563 /*
564  * RelationIsScannable
565  * Currently can only be false for a materialized view which has not been
566  * populated by its query. This is likely to get more complicated later,
567  * so use a macro which looks like a function.
568  */
569 #define RelationIsScannable(relation) ((relation)->rd_rel->relispopulated)
570 
571 /*
572  * RelationIsPopulated
573  * Currently, we don't physically distinguish the "populated" and
574  * "scannable" properties of matviews, but that may change later.
575  * Hence, use the appropriate one of these macros in code tests.
576  */
577 #define RelationIsPopulated(relation) ((relation)->rd_rel->relispopulated)
578 
579 /*
580  * RelationIsAccessibleInLogicalDecoding
581  * True if we need to log enough information to have access via
582  * decoding snapshot.
583  */
584 #define RelationIsAccessibleInLogicalDecoding(relation) \
585  (XLogLogicalInfoActive() && \
586  RelationNeedsWAL(relation) && \
587  (IsCatalogRelation(relation) || RelationIsUsedAsCatalogTable(relation)))
588 
589 /*
590  * RelationIsLogicallyLogged
591  * True if we need to log enough information to extract the data from the
592  * WAL stream.
593  *
594  * We don't log information for unlogged tables (since they don't WAL log
595  * anyway) and for system tables (their content is hard to make sense of, and
596  * it would complicate decoding slightly for little gain). Note that we *do*
597  * log information for user defined catalog tables since they presumably are
598  * interesting to the user...
599  */
600 #define RelationIsLogicallyLogged(relation) \
601  (XLogLogicalInfoActive() && \
602  RelationNeedsWAL(relation) && \
603  !IsCatalogRelation(relation))
604 
605 /* routines in utils/cache/relcache.c */
608 
609 #endif /* REL_H */
struct FdwRoutine * rd_fdwroutine
Definition: rel.h:196
signed short int16
Definition: c.h:346
struct IndexAmRoutine * rd_indam
Definition: rel.h:163
Definition: fmgr.h:56
LockRelId lockRelId
Definition: rel.h:44
int16 * rd_indoption
Definition: rel.h:168
struct LockInfoData LockInfoData
PublicationActions * rd_pubactions
Definition: rel.h:125
struct FmgrInfo * rd_supportinfo
Definition: rel.h:167
Bitmapset * rd_keyattr
Definition: rel.h:121
float8 vacuum_scale_factor
Definition: rel.h:265
int freeze_min_age
Definition: rel.h:257
Oid rd_replidindex
Definition: rel.h:114
struct SMgrRelationData * rd_smgr
Definition: rel.h:57
bool rd_isnailed
Definition: rel.h:61
regproc RegProcedure
Definition: c.h:512
bool rd_islocaltemp
Definition: rel.h:60
Oid dbId
Definition: rel.h:39
struct ForeignKeyCacheInfo ForeignKeyCacheInfo
uint16 * rd_exclstrats
Definition: rel.h:173
List * rd_indexprs
Definition: rel.h:169
List * rd_fkeylist
Definition: rel.h:95
bool rd_partcheckvalid
Definition: rel.h:108
int fillfactor
Definition: rel.h:272
bool rd_isvalid
Definition: rel.h:62
SubTransactionId rd_newRelfilenodeSubid
Definition: rel.h:81
struct AutoVacOpts AutoVacOpts
MemoryContext rd_rulescxt
Definition: rel.h:89
uint32 SubTransactionId
Definition: c.h:518
Oid * rd_exclprocs
Definition: rel.h:172
Form_pg_class rd_rel
Definition: rel.h:84
unsigned int Oid
Definition: postgres_ext.h:31
NodeTag
Definition: nodes.h:26
ViewOptCheckOption check_option
Definition: rel.h:351
bool vacuum_truncate
Definition: rel.h:279
LockInfoData * LockInfo
Definition: rel.h:47
signed int int32
Definition: c.h:347
struct HeapTupleData * rd_indextuple
Definition: rel.h:151
int freeze_table_age
Definition: rel.h:259
int parallel_workers
Definition: rel.h:277
int32 vl_len_
Definition: rel.h:271
Form_pg_index rd_index
Definition: rel.h:149
PartitionKey rd_partkey
Definition: rel.h:99
unsigned short uint16
Definition: c.h:358
Oid * rd_indcollation
Definition: rel.h:174
Oid rd_amhandler
Definition: rel.h:141
double float8
Definition: c.h:492
Definition: rel.h:36
int toast_tuple_target
Definition: rel.h:274
bool security_barrier
Definition: rel.h:350
Oid rd_pkindex
Definition: rel.h:113
int32 vl_len_
Definition: rel.h:349
float8 vacuum_cost_delay
Definition: rel.h:264
TriggerDesc * trigdesc
Definition: rel.h:90
NodeTag type
Definition: rel.h:230
int analyze_threshold
Definition: rel.h:255
LockInfoData rd_lockInfo
Definition: rel.h:87
Oid rd_toastoid
Definition: rel.h:207
List * rd_indpred
Definition: rel.h:170
Oid * rd_opfamily
Definition: rel.h:164
Oid * rd_exclops
Definition: rel.h:171
PartitionDesc rd_partdesc
Definition: rel.h:103
List * rd_indexlist
Definition: rel.h:112
struct RowSecurityDesc * rd_rsdesc
Definition: rel.h:92
RegProcedure * rd_support
Definition: rel.h:166
struct LockRelId LockRelId
Oid rd_id
Definition: rel.h:86
bool vacuum_index_cleanup
Definition: rel.h:278
void RelationDecrementReferenceCount(Relation rel)
Definition: relcache.c:2054
FormData_pg_index * Form_pg_index
Definition: pg_index.h:66
SubTransactionId rd_createSubid
Definition: rel.h:80
bool rd_indexvalid
Definition: rel.h:63
struct StdRdOptions StdRdOptions
int multixact_freeze_table_age
Definition: rel.h:262
int vacuum_threshold
Definition: rel.h:254
ViewOptCheckOption
Definition: rel.h:336
int BackendId
Definition: backendid.h:21
const struct TableAmRoutine * rd_tableam
Definition: rel.h:146
TupleDesc rd_att
Definition: rel.h:85
Bitmapset * rd_idattr
Definition: rel.h:123
float8 analyze_scale_factor
Definition: rel.h:266
RelFileNode rd_node
Definition: rel.h:55
int freeze_max_age
Definition: rel.h:258
int vacuum_cost_limit
Definition: rel.h:256
MemoryContext rd_pdcxt
Definition: rel.h:104
BackendId rd_backend
Definition: rel.h:59
bool enabled
Definition: rel.h:253
MemoryContext rd_partkeycxt
Definition: rel.h:100
int multixact_freeze_min_age
Definition: rel.h:260
RuleLock * rd_rules
Definition: rel.h:88
#define INDEX_MAX_KEYS
struct PgStat_TableStatus * pgstat_info
Definition: rel.h:210
int log_min_duration
Definition: rel.h:263
FormData_pg_class * Form_pg_class
Definition: pg_class.h:150
Bitmapset * rd_pkattr
Definition: rel.h:122
bool rd_statvalid
Definition: rel.h:65
struct ViewOptions ViewOptions
int rd_refcnt
Definition: rel.h:58
MemoryContext rd_indexcxt
Definition: rel.h:161
int multixact_freeze_max_age
Definition: rel.h:261
Definition: c.h:556
MemoryContext rd_partcheckcxt
Definition: rel.h:109
void RelationIncrementReferenceCount(Relation rel)
Definition: relcache.c:2041
void * rd_amcache
Definition: rel.h:185
Oid * rd_opcintype
Definition: rel.h:165
struct RelationData RelationData
List * rd_statlist
Definition: rel.h:117
Definition: pg_list.h:50
bool rd_fkeyvalid
Definition: rel.h:96
int16 AttrNumber
Definition: attnum.h:21
List * rd_partcheck
Definition: rel.h:107
Bitmapset * rd_indexattr
Definition: rel.h:120
bytea * rd_options
Definition: rel.h:132
bool user_catalog_table
Definition: rel.h:276
Oid relId
Definition: rel.h:38
AutoVacOpts autovacuum
Definition: rel.h:275