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