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