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