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