yb_ddl_parser 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (926) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +177 -0
  3. data/LICENSES/Apache-2.0.txt +4 -0
  4. data/LICENSES/PostgreSQL.txt +24 -0
  5. data/README.md +93 -0
  6. data/THIRD_PARTY_NOTICES.md +47 -0
  7. data/VERSION +1 -0
  8. data/ext/yb_ddl_parser/extconf.rb +41 -0
  9. data/ext/yb_ddl_parser/vendor/compat/postgres/pg_config.h +1021 -0
  10. data/ext/yb_ddl_parser/vendor/compat/postgres/pg_config_ext.h +8 -0
  11. data/ext/yb_ddl_parser/vendor/compat/postgres/pg_config_os.h +8 -0
  12. data/ext/yb_ddl_parser/vendor/compat/postgres/yb/yql/pggate/util/ybc_util.h +53 -0
  13. data/ext/yb_ddl_parser/vendor/compat/postgres/yb/yql/pggate/ybc_dist_trace.h +12 -0
  14. data/ext/yb_ddl_parser/vendor/compat/postgres/yb/yql/pggate/ybc_gflags.h +17 -0
  15. data/ext/yb_ddl_parser/vendor/compat/postgres/yb/yql/pggate/ybc_pg_typedefs.h +184 -0
  16. data/ext/yb_ddl_parser/vendor/compat/postgres/yb/yql/pggate/ybc_pggate.h +6 -0
  17. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/backend/nodes/list.c +1676 -0
  18. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/backend/nodes/makefuncs.c +824 -0
  19. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/backend/nodes/nodes.c +31 -0
  20. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/backend/nodes/outfuncs.c +4948 -0
  21. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/backend/nodes/value.c +83 -0
  22. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/backend/parser/gram.c +52142 -0
  23. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/backend/parser/gram.h +1135 -0
  24. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/backend/parser/parser.c +501 -0
  25. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/backend/parser/scan.c +9319 -0
  26. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/backend/parser/scansup.c +127 -0
  27. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/common/keywords.c +48 -0
  28. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/common/kwlist_d.h +1128 -0
  29. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/common/kwlookup.c +85 -0
  30. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/access/amapi.h +399 -0
  31. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/access/amvalidate.h +40 -0
  32. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/access/attmap.h +53 -0
  33. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/access/attnum.h +64 -0
  34. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/access/brin.h +55 -0
  35. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/access/brin_internal.h +115 -0
  36. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/access/brin_page.h +96 -0
  37. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/access/brin_pageops.h +38 -0
  38. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/access/brin_revmap.h +41 -0
  39. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/access/brin_tuple.h +112 -0
  40. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/access/brin_xlog.h +151 -0
  41. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/access/bufmask.h +32 -0
  42. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/access/clog.h +63 -0
  43. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/access/commit_ts.h +74 -0
  44. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/access/detoast.h +82 -0
  45. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/access/genam.h +267 -0
  46. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/access/generic_xlog.h +45 -0
  47. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/access/gin.h +78 -0
  48. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/access/gin_private.h +500 -0
  49. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/access/ginblock.h +346 -0
  50. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/access/ginxlog.h +216 -0
  51. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/access/gist.h +248 -0
  52. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/access/gist_private.h +571 -0
  53. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/access/gistscan.h +24 -0
  54. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/access/gistxlog.h +114 -0
  55. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/access/hash.h +485 -0
  56. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/access/hash_xlog.h +267 -0
  57. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/access/heapam.h +242 -0
  58. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/access/heapam_xlog.h +420 -0
  59. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/access/heaptoast.h +151 -0
  60. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/access/hio.h +43 -0
  61. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/access/htup.h +90 -0
  62. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/access/htup_details.h +812 -0
  63. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/access/itup.h +181 -0
  64. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/access/multixact.h +164 -0
  65. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/access/nbtree.h +1293 -0
  66. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/access/nbtxlog.h +351 -0
  67. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/access/parallel.h +82 -0
  68. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/access/printsimple.h +23 -0
  69. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/access/printtup.h +35 -0
  70. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/access/relation.h +28 -0
  71. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/access/reloptions.h +275 -0
  72. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/access/relscan.h +242 -0
  73. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/access/rewriteheap.h +57 -0
  74. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/access/rmgr.h +62 -0
  75. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/access/rmgrlist.h +49 -0
  76. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/access/sdir.h +58 -0
  77. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/access/session.h +44 -0
  78. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/access/skey.h +229 -0
  79. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/access/slru.h +174 -0
  80. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/access/spgist.h +229 -0
  81. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/access/spgist_private.h +549 -0
  82. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/access/spgxlog.h +257 -0
  83. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/access/stratnum.h +85 -0
  84. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/access/subtrans.h +29 -0
  85. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/access/syncscan.h +25 -0
  86. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/access/sysattr.h +45 -0
  87. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/access/table.h +28 -0
  88. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/access/tableam.h +2127 -0
  89. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/access/timeline.h +44 -0
  90. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/access/toast_compression.h +73 -0
  91. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/access/toast_helper.h +116 -0
  92. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/access/toast_internals.h +63 -0
  93. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/access/transam.h +403 -0
  94. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/access/tsmapi.h +82 -0
  95. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/access/tupconvert.h +54 -0
  96. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/access/tupdesc.h +154 -0
  97. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/access/tupdesc_details.h +28 -0
  98. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/access/tupmacs.h +247 -0
  99. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/access/twophase.h +65 -0
  100. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/access/twophase_rmgr.h +40 -0
  101. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/access/valid.h +69 -0
  102. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/access/visibilitymap.h +42 -0
  103. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/access/visibilitymapdefs.h +25 -0
  104. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/access/xact.h +586 -0
  105. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/access/xlog.h +305 -0
  106. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/access/xlog_internal.h +366 -0
  107. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/access/xlogarchive.h +35 -0
  108. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/access/xlogdefs.h +101 -0
  109. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/access/xloginsert.h +66 -0
  110. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/access/xlogprefetcher.h +55 -0
  111. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/access/xlogreader.h +450 -0
  112. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/access/xlogrecord.h +236 -0
  113. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/access/xlogrecovery.h +157 -0
  114. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/access/xlogstats.h +43 -0
  115. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/access/xlogutils.h +118 -0
  116. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/access/yb_pg_inherits_scan.h +36 -0
  117. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/access/yb_scan.h +421 -0
  118. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/access/yb_sys_scan_base.h +41 -0
  119. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/access/ybgin.h +75 -0
  120. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/access/ybgin_private.h +51 -0
  121. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/backup/backup_manifest.h +54 -0
  122. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/backup/basebackup.h +39 -0
  123. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/backup/basebackup_sink.h +301 -0
  124. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/backup/basebackup_target.h +66 -0
  125. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/bootstrap/bootstrap.h +62 -0
  126. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/bootstrap/yb_bootstrap.h +44 -0
  127. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/c.h +1424 -0
  128. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/binary_upgrade.h +42 -0
  129. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/catalog.h +70 -0
  130. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/catversion.h +59 -0
  131. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/dependency.h +296 -0
  132. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/genbki.h +143 -0
  133. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/heap.h +165 -0
  134. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/index.h +268 -0
  135. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/indexing.h +57 -0
  136. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/namespace.h +190 -0
  137. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/objectaccess.h +265 -0
  138. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/objectaddress.h +93 -0
  139. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/partition.h +34 -0
  140. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_aggregate.h +180 -0
  141. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_aggregate_d.h +78 -0
  142. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_am.h +63 -0
  143. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_am_d.h +49 -0
  144. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_amop.h +102 -0
  145. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_amop_d.h +44 -0
  146. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_amproc.h +73 -0
  147. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_amproc_d.h +35 -0
  148. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_attrdef.h +70 -0
  149. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_attrdef_d.h +33 -0
  150. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_attribute.h +221 -0
  151. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_attribute_d.h +62 -0
  152. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_auth_members.h +48 -0
  153. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_auth_members_d.h +34 -0
  154. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_authid.h +63 -0
  155. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_authid_d.h +60 -0
  156. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_cast.h +102 -0
  157. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_cast_d.h +64 -0
  158. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_class.h +240 -0
  159. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_class_d.h +142 -0
  160. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_collation.h +98 -0
  161. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_collation_d.h +62 -0
  162. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_constraint.h +276 -0
  163. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_constraint_d.h +73 -0
  164. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_control.h +250 -0
  165. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_conversion.h +75 -0
  166. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_conversion_d.h +38 -0
  167. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_database.h +121 -0
  168. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_database_d.h +51 -0
  169. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_db_role_setting.h +61 -0
  170. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_db_role_setting_d.h +33 -0
  171. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_default_acl.h +73 -0
  172. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_default_acl_d.h +47 -0
  173. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_depend.h +77 -0
  174. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_depend_d.h +36 -0
  175. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_description.h +73 -0
  176. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_description_d.h +32 -0
  177. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_enum.h +66 -0
  178. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_enum_d.h +34 -0
  179. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_event_trigger.h +57 -0
  180. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_event_trigger_d.h +36 -0
  181. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_extension.h +59 -0
  182. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_extension_d.h +37 -0
  183. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_foreign_data_wrapper.h +58 -0
  184. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_foreign_data_wrapper_d.h +36 -0
  185. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_foreign_server.h +55 -0
  186. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_foreign_server_d.h +37 -0
  187. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_foreign_table.h +49 -0
  188. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_foreign_table_d.h +31 -0
  189. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_index.h +93 -0
  190. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_index_d.h +62 -0
  191. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_inherits.h +66 -0
  192. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_inherits_d.h +33 -0
  193. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_init_privs.h +83 -0
  194. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_init_privs_d.h +33 -0
  195. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_language.h +72 -0
  196. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_language_d.h +41 -0
  197. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_largeobject.h +53 -0
  198. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_largeobject_d.h +31 -0
  199. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_largeobject_metadata.h +51 -0
  200. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_largeobject_metadata_d.h +31 -0
  201. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_namespace.h +64 -0
  202. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_namespace_d.h +36 -0
  203. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_opclass.h +88 -0
  204. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_opclass_d.h +65 -0
  205. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_operator.h +107 -0
  206. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_operator_d.h +142 -0
  207. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_opfamily.h +63 -0
  208. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_opfamily_d.h +59 -0
  209. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_parameter_acl.h +60 -0
  210. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_parameter_acl_d.h +34 -0
  211. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_partitioned_table.h +74 -0
  212. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_partitioned_table_d.h +36 -0
  213. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_policy.h +58 -0
  214. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_policy_d.h +37 -0
  215. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_proc.h +220 -0
  216. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_proc_d.h +101 -0
  217. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_publication.h +168 -0
  218. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_publication_d.h +38 -0
  219. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_publication_namespace.h +47 -0
  220. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_publication_namespace_d.h +32 -0
  221. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_publication_rel.h +54 -0
  222. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_publication_rel_d.h +35 -0
  223. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_range.h +72 -0
  224. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_range_d.h +36 -0
  225. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_replication_origin.h +62 -0
  226. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_replication_origin_d.h +33 -0
  227. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_rewrite.h +59 -0
  228. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_rewrite_d.h +37 -0
  229. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_seclabel.h +45 -0
  230. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_seclabel_d.h +33 -0
  231. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_sequence.h +44 -0
  232. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_sequence_d.h +36 -0
  233. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_shdepend.h +78 -0
  234. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_shdepend_d.h +36 -0
  235. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_shdescription.h +65 -0
  236. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_shdescription_d.h +33 -0
  237. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_shseclabel.h +46 -0
  238. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_shseclabel_d.h +35 -0
  239. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_statistic.h +282 -0
  240. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_statistic_d.h +195 -0
  241. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_statistic_ext.h +88 -0
  242. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_statistic_ext_d.h +45 -0
  243. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_statistic_ext_data.h +60 -0
  244. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_statistic_ext_data_d.h +34 -0
  245. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_subscription.h +131 -0
  246. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_subscription_d.h +46 -0
  247. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_subscription_rel.h +94 -0
  248. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_subscription_rel_d.h +51 -0
  249. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_tablespace.h +55 -0
  250. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_tablespace_d.h +38 -0
  251. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_transform.h +48 -0
  252. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_transform_d.h +34 -0
  253. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_trigger.h +153 -0
  254. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_trigger_d.h +109 -0
  255. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_ts_config.h +53 -0
  256. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_ts_config_d.h +34 -0
  257. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_ts_config_map.h +49 -0
  258. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_ts_config_map_d.h +32 -0
  259. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_ts_dict.h +59 -0
  260. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_ts_dict_d.h +35 -0
  261. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_ts_parser.h +60 -0
  262. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_ts_parser_d.h +37 -0
  263. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_ts_template.h +51 -0
  264. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_ts_template_d.h +34 -0
  265. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_type.h +411 -0
  266. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_type_d.h +324 -0
  267. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_user_mapping.h +55 -0
  268. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_user_mapping_d.h +33 -0
  269. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_yb_catalog_version.h +53 -0
  270. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_yb_catalog_version_d.h +32 -0
  271. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_yb_invalidation_messages.h +55 -0
  272. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_yb_invalidation_messages_d.h +33 -0
  273. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_yb_logical_client_version.h +46 -0
  274. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_yb_logical_client_version_d.h +31 -0
  275. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_yb_migration.h +58 -0
  276. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_yb_migration_d.h +32 -0
  277. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_yb_profile.h +47 -0
  278. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_yb_profile_d.h +34 -0
  279. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_yb_role_profile.h +58 -0
  280. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_yb_role_profile_d.h +35 -0
  281. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_yb_tablegroup.h +50 -0
  282. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/pg_yb_tablegroup_d.h +35 -0
  283. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/schemapg.h +276 -0
  284. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/storage.h +50 -0
  285. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/storage_xlog.h +59 -0
  286. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/system_fk_info.h +253 -0
  287. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/toasting.h +30 -0
  288. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/yb_catalog_version.h +65 -0
  289. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/yb_logical_client_version.h +40 -0
  290. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/yb_oid_assignment.h +39 -0
  291. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/catalog/yb_type.h +68 -0
  292. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/commands/alter.h +35 -0
  293. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/commands/async.h +62 -0
  294. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/commands/cluster.h +55 -0
  295. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/commands/collationcmds.h +25 -0
  296. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/commands/comment.h +45 -0
  297. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/commands/conversioncmds.h +23 -0
  298. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/commands/copy.h +120 -0
  299. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/commands/copyfrom_internal.h +176 -0
  300. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/commands/createas.h +34 -0
  301. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/commands/dbcommands.h +36 -0
  302. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/commands/dbcommands_xlog.h +60 -0
  303. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/commands/defrem.h +169 -0
  304. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/commands/discard.h +20 -0
  305. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/commands/event_trigger.h +96 -0
  306. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/commands/explain.h +159 -0
  307. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/commands/extension.h +55 -0
  308. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/commands/lockcmds.h +24 -0
  309. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/commands/matview.h +34 -0
  310. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/commands/policy.h +41 -0
  311. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/commands/portalcmds.h +34 -0
  312. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/commands/prepare.h +62 -0
  313. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/commands/proclang.h +23 -0
  314. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/commands/progress.h +173 -0
  315. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/commands/publicationcmds.h +39 -0
  316. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/commands/schemacmds.h +29 -0
  317. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/commands/seclabel.h +34 -0
  318. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/commands/sequence.h +70 -0
  319. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/commands/subscriptioncmds.h +29 -0
  320. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/commands/tablecmds.h +108 -0
  321. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/commands/tablespace.h +82 -0
  322. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/commands/trigger.h +323 -0
  323. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/commands/typecmds.h +61 -0
  324. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/commands/user.h +37 -0
  325. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/commands/vacuum.h +340 -0
  326. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/commands/variable.h +50 -0
  327. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/commands/view.h +25 -0
  328. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/commands/yb_cmds.h +168 -0
  329. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/commands/yb_profile.h +51 -0
  330. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/commands/yb_tablegroup.h +45 -0
  331. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/common/archive.h +21 -0
  332. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/common/base64.h +19 -0
  333. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/common/checksum_helper.h +72 -0
  334. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/common/compression.h +45 -0
  335. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/common/config_info.h +21 -0
  336. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/common/connect.h +28 -0
  337. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/common/controldata_utils.h +19 -0
  338. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/common/cryptohash.h +39 -0
  339. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/common/fe_memutils.h +73 -0
  340. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/common/file_perm.h +56 -0
  341. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/common/file_utils.h +40 -0
  342. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/common/hashfn.h +104 -0
  343. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/common/hmac.h +30 -0
  344. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/common/int.h +441 -0
  345. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/common/int128.h +276 -0
  346. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/common/ip.h +31 -0
  347. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/common/jsonapi.h +169 -0
  348. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/common/keywords.h +29 -0
  349. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/common/kwlookup.h +44 -0
  350. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/common/link-canary.h +17 -0
  351. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/common/logging.h +158 -0
  352. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/common/md5.h +37 -0
  353. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/common/openssl.h +49 -0
  354. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/common/pg_lzcompress.h +93 -0
  355. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/common/pg_prng.h +60 -0
  356. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/common/pg_yb_common.h +160 -0
  357. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/common/pg_yb_param_status_flags.h +33 -0
  358. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/common/relpath.h +90 -0
  359. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/common/restricted_token.h +24 -0
  360. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/common/saslprep.h +30 -0
  361. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/common/scram-common.h +62 -0
  362. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/common/sha1.h +21 -0
  363. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/common/sha2.h +32 -0
  364. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/common/shortest_dec.h +63 -0
  365. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/common/string.h +42 -0
  366. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/common/unicode_combining_table.h +308 -0
  367. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/common/unicode_east_asian_fw_table.h +125 -0
  368. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/common/unicode_norm.h +39 -0
  369. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/common/unicode_norm_hashfunc.h +2956 -0
  370. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/common/unicode_norm_table.h +9042 -0
  371. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/common/unicode_normprops_table.h +7849 -0
  372. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/common/username.h +15 -0
  373. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/datatype/timestamp.h +236 -0
  374. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/executor/execAsync.h +25 -0
  375. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/executor/execExpr.h +792 -0
  376. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/executor/execParallel.h +51 -0
  377. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/executor/execPartition.h +134 -0
  378. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/executor/execdebug.h +130 -0
  379. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/executor/execdesc.h +77 -0
  380. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/executor/executor.h +718 -0
  381. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/executor/functions.h +61 -0
  382. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/executor/hashjoin.h +363 -0
  383. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/executor/instrument.h +154 -0
  384. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/executor/nodeAgg.h +333 -0
  385. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/executor/nodeAppend.h +30 -0
  386. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/executor/nodeBitmapAnd.h +24 -0
  387. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/executor/nodeBitmapHeapscan.h +32 -0
  388. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/executor/nodeBitmapIndexscan.h +24 -0
  389. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/executor/nodeBitmapOr.h +24 -0
  390. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/executor/nodeCtescan.h +23 -0
  391. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/executor/nodeCustom.h +42 -0
  392. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/executor/nodeForeignscan.h +44 -0
  393. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/executor/nodeFunctionscan.h +23 -0
  394. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/executor/nodeGather.h +24 -0
  395. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/executor/nodeGatherMerge.h +26 -0
  396. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/executor/nodeGroup.h +23 -0
  397. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/executor/nodeHash.h +79 -0
  398. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/executor/nodeHashjoin.h +34 -0
  399. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/executor/nodeIncrementalSort.h +28 -0
  400. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/executor/nodeIndexonlyscan.h +36 -0
  401. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/executor/nodeIndexscan.h +47 -0
  402. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/executor/nodeLimit.h +23 -0
  403. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/executor/nodeLockRows.h +26 -0
  404. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/executor/nodeMaterial.h +25 -0
  405. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/executor/nodeMemoize.h +32 -0
  406. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/executor/nodeMergeAppend.h +23 -0
  407. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/executor/nodeMergejoin.h +23 -0
  408. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/executor/nodeModifyTable.h +33 -0
  409. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/executor/nodeNamedtuplestorescan.h +23 -0
  410. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/executor/nodeNestloop.h +23 -0
  411. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/executor/nodeProjectSet.h +23 -0
  412. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/executor/nodeRecursiveunion.h +23 -0
  413. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/executor/nodeResult.h +25 -0
  414. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/executor/nodeSamplescan.h +23 -0
  415. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/executor/nodeSeqscan.h +31 -0
  416. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/executor/nodeSetOp.h +23 -0
  417. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/executor/nodeSort.h +32 -0
  418. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/executor/nodeSubplan.h +29 -0
  419. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/executor/nodeSubqueryscan.h +23 -0
  420. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/executor/nodeTableFuncscan.h +23 -0
  421. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/executor/nodeTidrangescan.h +24 -0
  422. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/executor/nodeTidscan.h +23 -0
  423. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/executor/nodeUnique.h +23 -0
  424. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/executor/nodeValuesscan.h +23 -0
  425. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/executor/nodeWindowAgg.h +23 -0
  426. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/executor/nodeWorktablescan.h +23 -0
  427. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/executor/nodeYbBatchedNestloop.h +33 -0
  428. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/executor/nodeYbBitmapIndexscan.h +24 -0
  429. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/executor/nodeYbBitmapTablescan.h +22 -0
  430. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/executor/nodeYbSeqscan.h +45 -0
  431. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/executor/spi.h +214 -0
  432. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/executor/spi_priv.h +105 -0
  433. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/executor/tablefunc.h +67 -0
  434. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/executor/tqueue.h +32 -0
  435. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/executor/tstoreReceiver.h +31 -0
  436. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/executor/tuptable.h +515 -0
  437. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/executor/ybExpr.h +64 -0
  438. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/executor/ybFunction.h +41 -0
  439. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/executor/ybModifyTable.h +281 -0
  440. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/executor/ybOptimizeModifyTable.h +40 -0
  441. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/fe_utils/archive.h +21 -0
  442. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/fe_utils/cancel.h +32 -0
  443. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/fe_utils/conditional.h +102 -0
  444. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/fe_utils/connect_utils.h +48 -0
  445. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/fe_utils/mbprint.h +29 -0
  446. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/fe_utils/option_utils.h +26 -0
  447. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/fe_utils/parallel_slot.h +77 -0
  448. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/fe_utils/print.h +220 -0
  449. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/fe_utils/psqlscan.h +90 -0
  450. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/fe_utils/psqlscan_int.h +157 -0
  451. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/fe_utils/query_utils.h +26 -0
  452. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/fe_utils/recovery_gen.h +28 -0
  453. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/fe_utils/simple_list.h +70 -0
  454. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/fe_utils/string_utils.h +69 -0
  455. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/fmgr.h +788 -0
  456. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/foreign/fdwapi.h +294 -0
  457. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/foreign/foreign.h +84 -0
  458. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/funcapi.h +409 -0
  459. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/getaddrinfo.h +162 -0
  460. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/getopt_long.h +36 -0
  461. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/jit/SectionMemoryManager.h +226 -0
  462. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/jit/jit.h +105 -0
  463. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/jit/llvmjit.h +169 -0
  464. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/jit/llvmjit_backport.h +25 -0
  465. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/jit/llvmjit_emit.h +336 -0
  466. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/lib/binaryheap.h +54 -0
  467. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/lib/bipartite_match.h +46 -0
  468. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/lib/bloomfilter.h +27 -0
  469. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/lib/dshash.h +112 -0
  470. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/lib/hyperloglog.h +68 -0
  471. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/lib/ilist.h +746 -0
  472. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/lib/integerset.h +24 -0
  473. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/lib/knapsack.h +16 -0
  474. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/lib/pairingheap.h +102 -0
  475. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/lib/qunique.h +67 -0
  476. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/lib/rbtree.h +79 -0
  477. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/lib/simplehash.h +1187 -0
  478. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/lib/sort_template.h +441 -0
  479. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/lib/stringinfo.h +161 -0
  480. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/libpq/auth.h +31 -0
  481. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/libpq/be-fsstubs.h +32 -0
  482. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/libpq/be-gssapi-common.h +30 -0
  483. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/libpq/crypt.h +53 -0
  484. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/libpq/hba.h +191 -0
  485. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/libpq/ifaddr.h +30 -0
  486. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/libpq/libpq-be.h +365 -0
  487. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/libpq/libpq-fs.h +24 -0
  488. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/libpq/libpq.h +147 -0
  489. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/libpq/pqcomm.h +194 -0
  490. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/libpq/pqformat.h +210 -0
  491. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/libpq/pqmq.h +24 -0
  492. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/libpq/pqsignal.h +42 -0
  493. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/libpq/sasl.h +136 -0
  494. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/libpq/scram.h +30 -0
  495. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/libpq/yb_pqcomm_extensions.h +24 -0
  496. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/mb/pg_wchar.h +703 -0
  497. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/mb/stringinfo_mb.h +24 -0
  498. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/miscadmin.h +558 -0
  499. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/nodes/bitmapset.h +122 -0
  500. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/nodes/execnodes.h +3130 -0
  501. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/nodes/extensible.h +162 -0
  502. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/nodes/lockoptions.h +61 -0
  503. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/nodes/makefuncs.h +109 -0
  504. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/nodes/memnodes.h +113 -0
  505. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/nodes/nodeFuncs.h +165 -0
  506. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/nodes/nodes.h +897 -0
  507. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/nodes/params.h +170 -0
  508. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/nodes/parsenodes.h +3955 -0
  509. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/nodes/pathnodes.h +2984 -0
  510. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/nodes/pg_list.h +621 -0
  511. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/nodes/plannodes.h +1681 -0
  512. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/nodes/primnodes.h +1608 -0
  513. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/nodes/print.h +34 -0
  514. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/nodes/readfuncs.h +40 -0
  515. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/nodes/replnodes.h +111 -0
  516. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/nodes/subscripting.h +167 -0
  517. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/nodes/supportnodes.h +302 -0
  518. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/nodes/tidbitmap.h +84 -0
  519. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/nodes/value.h +80 -0
  520. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/nodes/ybbitmatrix.h +54 -0
  521. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/nodes/ybtidbitmap.h +89 -0
  522. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/optimizer/appendinfo.h +50 -0
  523. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/optimizer/clauses.h +62 -0
  524. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/optimizer/cost.h +309 -0
  525. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/optimizer/geqo.h +90 -0
  526. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/optimizer/geqo_copy.h +30 -0
  527. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/optimizer/geqo_gene.h +45 -0
  528. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/optimizer/geqo_misc.h +34 -0
  529. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/optimizer/geqo_mutation.h +30 -0
  530. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/optimizer/geqo_pool.h +40 -0
  531. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/optimizer/geqo_random.h +40 -0
  532. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/optimizer/geqo_recombination.h +89 -0
  533. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/optimizer/geqo_selection.h +33 -0
  534. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/optimizer/inherit.h +29 -0
  535. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/optimizer/joininfo.h +30 -0
  536. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/optimizer/optimizer.h +206 -0
  537. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/optimizer/orclauses.h +21 -0
  538. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/optimizer/paramassign.h +34 -0
  539. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/optimizer/pathnode.h +359 -0
  540. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/optimizer/paths.h +292 -0
  541. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/optimizer/placeholder.h +32 -0
  542. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/optimizer/plancat.h +82 -0
  543. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/optimizer/planmain.h +136 -0
  544. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/optimizer/planner.h +70 -0
  545. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/optimizer/prep.h +57 -0
  546. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/optimizer/restrictinfo.h +62 -0
  547. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/optimizer/subselect.h +40 -0
  548. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/optimizer/tlist.h +56 -0
  549. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/optimizer/yb_merge_scan.h +52 -0
  550. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/optimizer/ybplan.h +59 -0
  551. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/parser/analyze.h +64 -0
  552. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/parser/gramparse.h +75 -0
  553. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/parser/kwlist.h +502 -0
  554. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/parser/parse_agg.h +63 -0
  555. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/parser/parse_clause.h +54 -0
  556. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/parser/parse_coerce.h +103 -0
  557. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/parser/parse_collate.h +27 -0
  558. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/parser/parse_cte.h +24 -0
  559. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/parser/parse_enr.h +22 -0
  560. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/parser/parse_expr.h +25 -0
  561. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/parser/parse_func.h +74 -0
  562. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/parser/parse_merge.h +21 -0
  563. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/parser/parse_node.h +339 -0
  564. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/parser/parse_oper.h +65 -0
  565. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/parser/parse_param.h +25 -0
  566. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/parser/parse_relation.h +124 -0
  567. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/parser/parse_target.h +58 -0
  568. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/parser/parse_type.h +60 -0
  569. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/parser/parse_utilcmd.h +57 -0
  570. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/parser/parser.h +68 -0
  571. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/parser/parsetree.h +61 -0
  572. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/parser/scanner.h +150 -0
  573. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/parser/scansup.h +27 -0
  574. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/partitioning/partbounds.h +146 -0
  575. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/partitioning/partdefs.h +26 -0
  576. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/partitioning/partdesc.h +53 -0
  577. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/partitioning/partprune.h +85 -0
  578. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/pg_config_manual.h +410 -0
  579. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/pg_getopt.h +56 -0
  580. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/pg_trace.h +17 -0
  581. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/pg_yb_utils.h +1645 -0
  582. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/pgstat.h +900 -0
  583. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/pgtar.h +45 -0
  584. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/pgtime.h +94 -0
  585. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/port/aix.h +14 -0
  586. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/port/atomics/arch-arm.h +32 -0
  587. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/port/atomics/arch-hppa.h +17 -0
  588. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/port/atomics/arch-ia64.h +29 -0
  589. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/port/atomics/arch-ppc.h +254 -0
  590. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/port/atomics/arch-x86.h +252 -0
  591. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/port/atomics/fallback.h +170 -0
  592. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/port/atomics/generic-acc.h +106 -0
  593. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/port/atomics/generic-gcc.h +286 -0
  594. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/port/atomics/generic-msvc.h +101 -0
  595. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/port/atomics/generic-sunpro.h +106 -0
  596. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/port/atomics/generic.h +401 -0
  597. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/port/atomics.h +524 -0
  598. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/port/cygwin.h +23 -0
  599. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/port/darwin.h +8 -0
  600. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/port/freebsd.h +10 -0
  601. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/port/hpux.h +3 -0
  602. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/port/linux.h +22 -0
  603. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/port/netbsd.h +1 -0
  604. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/port/openbsd.h +1 -0
  605. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/port/pg_bitutils.h +302 -0
  606. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/port/pg_bswap.h +161 -0
  607. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/port/pg_crc32c.h +101 -0
  608. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/port/pg_iovec.h +54 -0
  609. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/port/pg_pthread.h +41 -0
  610. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/port/solaris.h +26 -0
  611. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/port/win32/arpa/inet.h +3 -0
  612. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/port/win32/dlfcn.h +1 -0
  613. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/port/win32/grp.h +1 -0
  614. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/port/win32/netdb.h +1 -0
  615. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/port/win32/netinet/in.h +3 -0
  616. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/port/win32/pwd.h +3 -0
  617. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/port/win32/sys/socket.h +33 -0
  618. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/port/win32/sys/wait.h +3 -0
  619. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/port/win32.h +81 -0
  620. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/port/win32_msvc/dirent.h +34 -0
  621. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/port/win32_msvc/sys/file.h +1 -0
  622. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/port/win32_msvc/sys/param.h +1 -0
  623. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/port/win32_msvc/sys/time.h +1 -0
  624. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/port/win32_msvc/unistd.h +9 -0
  625. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/port/win32_msvc/utime.h +3 -0
  626. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/port/win32_port.h +572 -0
  627. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/port/win32ntdll.h +32 -0
  628. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/port.h +589 -0
  629. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/portability/instr_time.h +256 -0
  630. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/portability/mem.h +48 -0
  631. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/postgres.h +819 -0
  632. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/postgres_ext.h +74 -0
  633. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/postgres_fe.h +29 -0
  634. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/postmaster/autovacuum.h +83 -0
  635. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/postmaster/auxprocess.h +20 -0
  636. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/postmaster/bgworker.h +176 -0
  637. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/postmaster/bgworker_internals.h +64 -0
  638. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/postmaster/bgwriter.h +45 -0
  639. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/postmaster/fork_process.h +17 -0
  640. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/postmaster/interrupt.h +32 -0
  641. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/postmaster/pgarch.h +73 -0
  642. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/postmaster/postmaster.h +86 -0
  643. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/postmaster/startup.h +41 -0
  644. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/postmaster/syslogger.h +103 -0
  645. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/postmaster/walwriter.h +21 -0
  646. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/regex/regcustom.h +104 -0
  647. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/regex/regerrs.h +87 -0
  648. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/regex/regex.h +269 -0
  649. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/regex/regexport.h +61 -0
  650. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/regex/regguts.h +552 -0
  651. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/replication/decode.h +34 -0
  652. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/replication/logical.h +178 -0
  653. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/replication/logicallauncher.h +29 -0
  654. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/replication/logicalproto.h +256 -0
  655. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/replication/logicalrelation.h +50 -0
  656. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/replication/logicalworker.h +19 -0
  657. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/replication/message.h +41 -0
  658. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/replication/origin.h +73 -0
  659. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/replication/output_plugin.h +271 -0
  660. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/replication/pgoutput.h +34 -0
  661. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/replication/reorderbuffer.h +706 -0
  662. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/replication/slot.h +290 -0
  663. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/replication/snapbuild.h +101 -0
  664. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/replication/syncrep.h +118 -0
  665. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/replication/walreceiver.h +472 -0
  666. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/replication/walsender.h +92 -0
  667. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/replication/walsender_private.h +131 -0
  668. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/replication/worker_internal.h +112 -0
  669. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/replication/yb_decode.h +33 -0
  670. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/replication/yb_virtual_wal_client.h +46 -0
  671. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/replication/yb_virtual_wal_client_typedefs.h +31 -0
  672. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/rewrite/prs2lock.h +46 -0
  673. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/rewrite/rewriteDefine.h +44 -0
  674. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/rewrite/rewriteHandler.h +35 -0
  675. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/rewrite/rewriteManip.h +87 -0
  676. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/rewrite/rewriteRemove.h +21 -0
  677. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/rewrite/rewriteSearchCycle.h +21 -0
  678. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/rewrite/rewriteSupport.h +26 -0
  679. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/rewrite/rowsecurity.h +49 -0
  680. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/rusagestub.h +34 -0
  681. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/snowball/header.h +67 -0
  682. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/snowball/libstemmer/api.h +32 -0
  683. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/snowball/libstemmer/header.h +61 -0
  684. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/snowball/libstemmer/stem_ISO_8859_1_basque.h +15 -0
  685. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/snowball/libstemmer/stem_ISO_8859_1_catalan.h +15 -0
  686. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/snowball/libstemmer/stem_ISO_8859_1_danish.h +15 -0
  687. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/snowball/libstemmer/stem_ISO_8859_1_dutch.h +15 -0
  688. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/snowball/libstemmer/stem_ISO_8859_1_english.h +15 -0
  689. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/snowball/libstemmer/stem_ISO_8859_1_finnish.h +15 -0
  690. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/snowball/libstemmer/stem_ISO_8859_1_french.h +15 -0
  691. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/snowball/libstemmer/stem_ISO_8859_1_german.h +15 -0
  692. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/snowball/libstemmer/stem_ISO_8859_1_indonesian.h +15 -0
  693. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/snowball/libstemmer/stem_ISO_8859_1_irish.h +15 -0
  694. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/snowball/libstemmer/stem_ISO_8859_1_italian.h +15 -0
  695. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/snowball/libstemmer/stem_ISO_8859_1_norwegian.h +15 -0
  696. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/snowball/libstemmer/stem_ISO_8859_1_porter.h +15 -0
  697. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/snowball/libstemmer/stem_ISO_8859_1_portuguese.h +15 -0
  698. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/snowball/libstemmer/stem_ISO_8859_1_spanish.h +15 -0
  699. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/snowball/libstemmer/stem_ISO_8859_1_swedish.h +15 -0
  700. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/snowball/libstemmer/stem_ISO_8859_2_hungarian.h +15 -0
  701. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/snowball/libstemmer/stem_ISO_8859_2_romanian.h +15 -0
  702. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/snowball/libstemmer/stem_KOI8_R_russian.h +15 -0
  703. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/snowball/libstemmer/stem_UTF_8_arabic.h +15 -0
  704. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/snowball/libstemmer/stem_UTF_8_armenian.h +15 -0
  705. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/snowball/libstemmer/stem_UTF_8_basque.h +15 -0
  706. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/snowball/libstemmer/stem_UTF_8_catalan.h +15 -0
  707. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/snowball/libstemmer/stem_UTF_8_danish.h +15 -0
  708. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/snowball/libstemmer/stem_UTF_8_dutch.h +15 -0
  709. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/snowball/libstemmer/stem_UTF_8_english.h +15 -0
  710. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/snowball/libstemmer/stem_UTF_8_finnish.h +15 -0
  711. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/snowball/libstemmer/stem_UTF_8_french.h +15 -0
  712. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/snowball/libstemmer/stem_UTF_8_german.h +15 -0
  713. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/snowball/libstemmer/stem_UTF_8_greek.h +15 -0
  714. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/snowball/libstemmer/stem_UTF_8_hindi.h +15 -0
  715. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/snowball/libstemmer/stem_UTF_8_hungarian.h +15 -0
  716. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/snowball/libstemmer/stem_UTF_8_indonesian.h +15 -0
  717. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/snowball/libstemmer/stem_UTF_8_irish.h +15 -0
  718. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/snowball/libstemmer/stem_UTF_8_italian.h +15 -0
  719. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/snowball/libstemmer/stem_UTF_8_lithuanian.h +15 -0
  720. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/snowball/libstemmer/stem_UTF_8_nepali.h +15 -0
  721. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/snowball/libstemmer/stem_UTF_8_norwegian.h +15 -0
  722. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/snowball/libstemmer/stem_UTF_8_porter.h +15 -0
  723. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/snowball/libstemmer/stem_UTF_8_portuguese.h +15 -0
  724. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/snowball/libstemmer/stem_UTF_8_romanian.h +15 -0
  725. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/snowball/libstemmer/stem_UTF_8_russian.h +15 -0
  726. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/snowball/libstemmer/stem_UTF_8_serbian.h +15 -0
  727. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/snowball/libstemmer/stem_UTF_8_spanish.h +15 -0
  728. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/snowball/libstemmer/stem_UTF_8_swedish.h +15 -0
  729. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/snowball/libstemmer/stem_UTF_8_tamil.h +15 -0
  730. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/snowball/libstemmer/stem_UTF_8_turkish.h +15 -0
  731. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/snowball/libstemmer/stem_UTF_8_yiddish.h +15 -0
  732. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/statistics/extended_stats_internal.h +130 -0
  733. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/statistics/stat_utils.h +41 -0
  734. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/statistics/statistics.h +130 -0
  735. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/storage/backendid.h +37 -0
  736. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/storage/barrier.h +46 -0
  737. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/storage/block.h +115 -0
  738. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/storage/buf.h +46 -0
  739. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/storage/buf_internals.h +345 -0
  740. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/storage/buffile.h +57 -0
  741. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/storage/bufmgr.h +297 -0
  742. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/storage/bufpage.h +457 -0
  743. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/storage/checksum.h +24 -0
  744. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/storage/checksum_impl.h +215 -0
  745. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/storage/condition_variable.h +86 -0
  746. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/storage/copydir.h +19 -0
  747. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/storage/dsm.h +64 -0
  748. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/storage/dsm_impl.h +76 -0
  749. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/storage/fd.h +198 -0
  750. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/storage/fileset.h +40 -0
  751. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/storage/freespace.h +39 -0
  752. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/storage/fsm_internals.h +72 -0
  753. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/storage/indexfsm.h +26 -0
  754. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/storage/ipc.h +87 -0
  755. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/storage/item.h +19 -0
  756. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/storage/itemid.h +184 -0
  757. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/storage/itemptr.h +208 -0
  758. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/storage/large_object.h +100 -0
  759. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/storage/latch.h +189 -0
  760. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/storage/lmgr.h +119 -0
  761. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/storage/lock.h +621 -0
  762. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/storage/lockdefs.h +61 -0
  763. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/storage/lwlock.h +220 -0
  764. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/storage/lwlocknames.h +50 -0
  765. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/storage/md.h +52 -0
  766. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/storage/off.h +57 -0
  767. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/storage/pg_sema.h +61 -0
  768. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/storage/pg_shmem.h +95 -0
  769. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/storage/pmsignal.h +105 -0
  770. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/storage/predicate.h +87 -0
  771. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/storage/predicate_internals.h +494 -0
  772. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/storage/proc.h +530 -0
  773. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/storage/procarray.h +101 -0
  774. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/storage/proclist.h +219 -0
  775. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/storage/proclist_types.h +51 -0
  776. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/storage/procsignal.h +81 -0
  777. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/storage/reinit.h +28 -0
  778. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/storage/relfilenode.h +99 -0
  779. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/storage/s_lock.h +1110 -0
  780. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/storage/sharedfileset.h +37 -0
  781. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/storage/shm_mq.h +86 -0
  782. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/storage/shm_toc.h +58 -0
  783. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/storage/shmem.h +81 -0
  784. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/storage/sinval.h +219 -0
  785. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/storage/sinvaladt.h +48 -0
  786. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/storage/smgr.h +114 -0
  787. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/storage/spin.h +96 -0
  788. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/storage/standby.h +106 -0
  789. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/storage/standbydefs.h +74 -0
  790. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/storage/sync.h +66 -0
  791. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/tcop/cmdtag.h +58 -0
  792. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/tcop/cmdtaglist.h +225 -0
  793. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/tcop/deparse_utility.h +108 -0
  794. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/tcop/dest.h +149 -0
  795. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/tcop/fastpath.h +20 -0
  796. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/tcop/pquery.h +60 -0
  797. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/tcop/tcopprot.h +108 -0
  798. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/tcop/utility.h +112 -0
  799. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/tsearch/dicts/regis.h +49 -0
  800. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/tsearch/dicts/spell.h +247 -0
  801. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/tsearch/ts_cache.h +98 -0
  802. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/tsearch/ts_locale.h +63 -0
  803. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/tsearch/ts_public.h +159 -0
  804. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/tsearch/ts_type.h +242 -0
  805. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/tsearch/ts_utils.h +266 -0
  806. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/utils/acl.h +340 -0
  807. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/utils/aclchk_internal.h +45 -0
  808. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/utils/array.h +472 -0
  809. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/utils/arrayaccess.h +118 -0
  810. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/utils/ascii.h +68 -0
  811. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/utils/attoptcache.h +28 -0
  812. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/utils/backend_progress.h +44 -0
  813. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/utils/backend_status.h +379 -0
  814. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/utils/builtins.h +130 -0
  815. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/utils/bytea.h +28 -0
  816. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/utils/cash.h +25 -0
  817. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/utils/catcache.h +268 -0
  818. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/utils/combocid.h +28 -0
  819. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/utils/date.h +90 -0
  820. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/utils/datetime.h +344 -0
  821. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/utils/datum.h +76 -0
  822. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/utils/dsa.h +123 -0
  823. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/utils/dynahash.h +20 -0
  824. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/utils/elog.h +517 -0
  825. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/utils/errcodes.h +363 -0
  826. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/utils/evtcache.h +37 -0
  827. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/utils/expandeddatum.h +159 -0
  828. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/utils/expandedrecord.h +231 -0
  829. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/utils/float.h +356 -0
  830. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/utils/fmgroids.h +3337 -0
  831. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/utils/fmgrprotos.h +2900 -0
  832. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/utils/fmgrtab.h +53 -0
  833. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/utils/formatting.h +35 -0
  834. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/utils/freepage.h +99 -0
  835. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/utils/geo_decls.h +221 -0
  836. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/utils/guc.h +517 -0
  837. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/utils/guc_tables.h +312 -0
  838. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/utils/help_config.h +17 -0
  839. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/utils/hsearch.h +153 -0
  840. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/utils/index_selfuncs.h +74 -0
  841. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/utils/inet.h +149 -0
  842. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/utils/inval.h +74 -0
  843. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/utils/json.h +24 -0
  844. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/utils/jsonb.h +415 -0
  845. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/utils/jsonfuncs.h +66 -0
  846. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/utils/jsonpath.h +251 -0
  847. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/utils/logtape.h +77 -0
  848. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/utils/lsyscache.h +211 -0
  849. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/utils/memdebug.h +82 -0
  850. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/utils/memutils.h +306 -0
  851. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/utils/multirangetypes.h +135 -0
  852. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/utils/numeric.h +99 -0
  853. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/utils/old_snapshot.h +75 -0
  854. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/utils/palloc.h +222 -0
  855. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/utils/partcache.h +105 -0
  856. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/utils/pg_crc.h +107 -0
  857. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/utils/pg_locale.h +129 -0
  858. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/utils/pg_lsn.h +29 -0
  859. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/utils/pg_rusage.h +37 -0
  860. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/utils/pgstat_internal.h +803 -0
  861. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/utils/pidfile.h +56 -0
  862. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/utils/plancache.h +259 -0
  863. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/utils/portal.h +252 -0
  864. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/utils/ps_status.h +25 -0
  865. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/utils/queryenvironment.h +74 -0
  866. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/utils/queryjumble.h +88 -0
  867. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/utils/rangetypes.h +151 -0
  868. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/utils/regproc.h +39 -0
  869. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/utils/rel.h +760 -0
  870. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/utils/relcache.h +180 -0
  871. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/utils/relfilenodemap.h +18 -0
  872. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/utils/relmapper.h +72 -0
  873. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/utils/relptr.h +93 -0
  874. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/utils/reltrigger.h +81 -0
  875. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/utils/resowner.h +86 -0
  876. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/utils/resowner_private.h +123 -0
  877. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/utils/rls.h +50 -0
  878. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/utils/ruleutils.h +59 -0
  879. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/utils/sampling.h +64 -0
  880. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/utils/selfuncs.h +250 -0
  881. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/utils/sharedtuplestore.h +61 -0
  882. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/utils/snapmgr.h +189 -0
  883. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/utils/snapshot.h +231 -0
  884. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/utils/sortsupport.h +391 -0
  885. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/utils/spccache.h +24 -0
  886. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/utils/syscache.h +319 -0
  887. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/utils/timeout.h +95 -0
  888. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/utils/timestamp.h +120 -0
  889. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/utils/tuplesort.h +291 -0
  890. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/utils/tuplestore.h +91 -0
  891. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/utils/typcache.h +209 -0
  892. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/utils/tzparser.h +39 -0
  893. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/utils/uuid.h +31 -0
  894. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/utils/varbit.h +74 -0
  895. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/utils/varlena.h +41 -0
  896. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/utils/wait_event.h +351 -0
  897. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/utils/xid8.h +22 -0
  898. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/utils/xml.h +84 -0
  899. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/utils/yb_inheritscache.h +49 -0
  900. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/utils/yb_jumblefuncs.h +35 -0
  901. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/utils/yb_like_support.h +37 -0
  902. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/utils/yb_queryjumble.h +73 -0
  903. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/utils/yb_rowtypes.h +24 -0
  904. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/utils/yb_tuplecache.h +66 -0
  905. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/windowapi.h +64 -0
  906. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/yb_ash.h +92 -0
  907. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/yb_file_utils.h +38 -0
  908. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/yb_overflow_utils.h +110 -0
  909. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/yb_qpm.h +45 -0
  910. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/yb_query_diagnostics.h +237 -0
  911. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/yb_tcmalloc_utils.h +41 -0
  912. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/yb_terminated_queries.h +35 -0
  913. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/yb_ysql_conn_mgr_helper.h +154 -0
  914. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/ybctid.h +55 -0
  915. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/ybgate/ybgate_api-test.h +78 -0
  916. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/ybgate/ybgate_api.h +283 -0
  917. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/ybgate/ybgate_cpp_util.h +78 -0
  918. data/ext/yb_ddl_parser/vendor/yugabyte-postgres/src/include/ybgate/ybgate_status.h +136 -0
  919. data/ext/yb_ddl_parser/yb_ddl_parser_ext.c +1740 -0
  920. data/ext/yb_ddl_parser/yb_parser_stubs.c +459 -0
  921. data/lib/yb_ddl_parser/ast.rb +276 -0
  922. data/lib/yb_ddl_parser/version.rb +6 -0
  923. data/lib/yb_ddl_parser.rb +32 -0
  924. data/test/test_helper.rb +5 -0
  925. data/test/yb_ddl_parser_test.rb +353 -0
  926. metadata +990 -0
@@ -0,0 +1,2127 @@
1
+ /*-------------------------------------------------------------------------
2
+ *
3
+ * tableam.h
4
+ * POSTGRES table access method definitions.
5
+ *
6
+ *
7
+ * Portions Copyright (c) 1996-2022, PostgreSQL Global Development Group
8
+ * Portions Copyright (c) 1994, Regents of the University of California
9
+ *
10
+ * src/include/access/tableam.h
11
+ *
12
+ * NOTES
13
+ * See tableam.sgml for higher level documentation.
14
+ *
15
+ *-------------------------------------------------------------------------
16
+ */
17
+ #ifndef TABLEAM_H
18
+ #define TABLEAM_H
19
+
20
+ #include "access/relscan.h"
21
+ #include "access/sdir.h"
22
+ #include "access/xact.h"
23
+ #include "utils/guc.h"
24
+ #include "utils/rel.h"
25
+ #include "utils/snapshot.h"
26
+
27
+
28
+ #define DEFAULT_TABLE_ACCESS_METHOD "heap"
29
+
30
+ /* GUCs */
31
+ extern PGDLLIMPORT char *default_table_access_method;
32
+ extern PGDLLIMPORT bool synchronize_seqscans;
33
+
34
+
35
+ struct BulkInsertStateData;
36
+ struct IndexInfo;
37
+ struct SampleScanState;
38
+ struct TBMIterateResult;
39
+ struct VacuumParams;
40
+ struct ValidateIndexState;
41
+
42
+ /*
43
+ * Bitmask values for the flags argument to the scan_begin callback.
44
+ */
45
+ typedef enum ScanOptions
46
+ {
47
+ /* one of SO_TYPE_* may be specified */
48
+ SO_TYPE_SEQSCAN = 1 << 0,
49
+ SO_TYPE_BITMAPSCAN = 1 << 1,
50
+ SO_TYPE_SAMPLESCAN = 1 << 2,
51
+ SO_TYPE_TIDSCAN = 1 << 3,
52
+ SO_TYPE_TIDRANGESCAN = 1 << 4,
53
+ SO_TYPE_ANALYZE = 1 << 5,
54
+
55
+ /* several of SO_ALLOW_* may be specified */
56
+ /* allow or disallow use of access strategy */
57
+ SO_ALLOW_STRAT = 1 << 6,
58
+ /* report location to syncscan logic? */
59
+ SO_ALLOW_SYNC = 1 << 7,
60
+ /* verify visibility page-at-a-time? */
61
+ SO_ALLOW_PAGEMODE = 1 << 8,
62
+
63
+ /* unregister snapshot at scan end? */
64
+ SO_TEMP_SNAPSHOT = 1 << 9
65
+ } ScanOptions;
66
+
67
+ /*
68
+ * Result codes for table_{update,delete,lock_tuple}, and for visibility
69
+ * routines inside table AMs.
70
+ */
71
+ typedef enum TM_Result
72
+ {
73
+ /*
74
+ * Signals that the action succeeded (i.e. update/delete performed, lock
75
+ * was acquired)
76
+ */
77
+ TM_Ok,
78
+
79
+ /* The affected tuple wasn't visible to the relevant snapshot */
80
+ TM_Invisible,
81
+
82
+ /* The affected tuple was already modified by the calling backend */
83
+ TM_SelfModified,
84
+
85
+ /*
86
+ * The affected tuple was updated by another transaction. This includes
87
+ * the case where tuple was moved to another partition.
88
+ */
89
+ TM_Updated,
90
+
91
+ /* The affected tuple was deleted by another transaction */
92
+ TM_Deleted,
93
+
94
+ /*
95
+ * The affected tuple is currently being modified by another session. This
96
+ * will only be returned if table_(update/delete/lock_tuple) are
97
+ * instructed not to wait.
98
+ */
99
+ TM_BeingModified,
100
+
101
+ /* lock couldn't be acquired, action skipped. Only used by lock_tuple */
102
+ TM_WouldBlock
103
+ } TM_Result;
104
+
105
+ /*
106
+ * When table_tuple_update, table_tuple_delete, or table_tuple_lock fail
107
+ * because the target tuple is already outdated, they fill in this struct to
108
+ * provide information to the caller about what happened.
109
+ *
110
+ * ctid is the target's ctid link: it is the same as the target's TID if the
111
+ * target was deleted, or the location of the replacement tuple if the target
112
+ * was updated.
113
+ *
114
+ * xmax is the outdating transaction's XID. If the caller wants to visit the
115
+ * replacement tuple, it must check that this matches before believing the
116
+ * replacement is really a match. This is InvalidTransactionId if the target
117
+ * was !LP_NORMAL (expected only for a TID retrieved from syscache).
118
+ *
119
+ * cmax is the outdating command's CID, but only when the failure code is
120
+ * TM_SelfModified (i.e., something in the current transaction outdated the
121
+ * tuple); otherwise cmax is zero. (We make this restriction because
122
+ * HeapTupleHeaderGetCmax doesn't work for tuples outdated in other
123
+ * transactions.)
124
+ */
125
+ typedef struct TM_FailureData
126
+ {
127
+ ItemPointerData ctid;
128
+ TransactionId xmax;
129
+ CommandId cmax;
130
+ bool traversed;
131
+ } TM_FailureData;
132
+
133
+ /*
134
+ * State used when calling table_index_delete_tuples().
135
+ *
136
+ * Represents the status of table tuples, referenced by table TID and taken by
137
+ * index AM from index tuples. State consists of high level parameters of the
138
+ * deletion operation, plus two mutable palloc()'d arrays for information
139
+ * about the status of individual table tuples. These are conceptually one
140
+ * single array. Using two arrays keeps the TM_IndexDelete struct small,
141
+ * which makes sorting the first array (the deltids array) fast.
142
+ *
143
+ * Some index AM callers perform simple index tuple deletion (by specifying
144
+ * bottomup = false), and include only known-dead deltids. These known-dead
145
+ * entries are all marked knowndeletable = true directly (typically these are
146
+ * TIDs from LP_DEAD-marked index tuples), but that isn't strictly required.
147
+ *
148
+ * Callers that specify bottomup = true are "bottom-up index deletion"
149
+ * callers. The considerations for the tableam are more subtle with these
150
+ * callers because they ask the tableam to perform highly speculative work,
151
+ * and might only expect the tableam to check a small fraction of all entries.
152
+ * Caller is not allowed to specify knowndeletable = true for any entry
153
+ * because everything is highly speculative. Bottom-up caller provides
154
+ * context and hints to tableam -- see comments below for details on how index
155
+ * AMs and tableams should coordinate during bottom-up index deletion.
156
+ *
157
+ * Simple index deletion callers may ask the tableam to perform speculative
158
+ * work, too. This is a little like bottom-up deletion, but not too much.
159
+ * The tableam will only perform speculative work when it's practically free
160
+ * to do so in passing for simple deletion caller (while always performing
161
+ * whatever work is needed to enable knowndeletable/LP_DEAD index tuples to
162
+ * be deleted within index AM). This is the real reason why it's possible for
163
+ * simple index deletion caller to specify knowndeletable = false up front
164
+ * (this means "check if it's possible for me to delete corresponding index
165
+ * tuple when it's cheap to do so in passing"). The index AM should only
166
+ * include "extra" entries for index tuples whose TIDs point to a table block
167
+ * that tableam is expected to have to visit anyway (in the event of a block
168
+ * orientated tableam). The tableam isn't strictly obligated to check these
169
+ * "extra" TIDs, but a block-based AM should always manage to do so in
170
+ * practice.
171
+ *
172
+ * The final contents of the deltids/status arrays are interesting to callers
173
+ * that ask tableam to perform speculative work (i.e. when _any_ items have
174
+ * knowndeletable set to false up front). These index AM callers will
175
+ * naturally need to consult final state to determine which index tuples are
176
+ * in fact deletable.
177
+ *
178
+ * The index AM can keep track of which index tuple relates to which deltid by
179
+ * setting idxoffnum (and/or relying on each entry being uniquely identifiable
180
+ * using tid), which is important when the final contents of the array will
181
+ * need to be interpreted -- the array can shrink from initial size after
182
+ * tableam processing and/or have entries in a new order (tableam may sort
183
+ * deltids array for its own reasons). Bottom-up callers may find that final
184
+ * ndeltids is 0 on return from call to tableam, in which case no index tuple
185
+ * deletions are possible. Simple deletion callers can rely on any entries
186
+ * they know to be deletable appearing in the final array as deletable.
187
+ */
188
+ typedef struct TM_IndexDelete
189
+ {
190
+ ItemPointerData tid; /* table TID from index tuple */
191
+ int16 id; /* Offset into TM_IndexStatus array */
192
+ } TM_IndexDelete;
193
+
194
+ typedef struct TM_IndexStatus
195
+ {
196
+ OffsetNumber idxoffnum; /* Index am page offset number */
197
+ bool knowndeletable; /* Currently known to be deletable? */
198
+
199
+ /* Bottom-up index deletion specific fields follow */
200
+ bool promising; /* Promising (duplicate) index tuple? */
201
+ int16 freespace; /* Space freed in index if deleted */
202
+ } TM_IndexStatus;
203
+
204
+ /*
205
+ * Index AM/tableam coordination is central to the design of bottom-up index
206
+ * deletion. The index AM provides hints about where to look to the tableam
207
+ * by marking some entries as "promising". Index AM does this with duplicate
208
+ * index tuples that are strongly suspected to be old versions left behind by
209
+ * UPDATEs that did not logically modify indexed values. Index AM may find it
210
+ * helpful to only mark entries as promising when they're thought to have been
211
+ * affected by such an UPDATE in the recent past.
212
+ *
213
+ * Bottom-up index deletion casts a wide net at first, usually by including
214
+ * all TIDs on a target index page. It is up to the tableam to worry about
215
+ * the cost of checking transaction status information. The tableam is in
216
+ * control, but needs careful guidance from the index AM. Index AM requests
217
+ * that bottomupfreespace target be met, while tableam measures progress
218
+ * towards that goal by tallying the per-entry freespace value for known
219
+ * deletable entries. (All !bottomup callers can just set these space related
220
+ * fields to zero.)
221
+ */
222
+ typedef struct TM_IndexDeleteOp
223
+ {
224
+ Relation irel; /* Target index relation */
225
+ BlockNumber iblknum; /* Index block number (for error reports) */
226
+ bool bottomup; /* Bottom-up (not simple) deletion? */
227
+ int bottomupfreespace; /* Bottom-up space target */
228
+
229
+ /* Mutable per-TID information follows (index AM initializes entries) */
230
+ int ndeltids; /* Current # of deltids/status elements */
231
+ TM_IndexDelete *deltids;
232
+ TM_IndexStatus *status;
233
+ } TM_IndexDeleteOp;
234
+
235
+ /* "options" flag bits for table_tuple_insert */
236
+ /* TABLE_INSERT_SKIP_WAL was 0x0001; RelationNeedsWAL() now governs */
237
+ #define TABLE_INSERT_SKIP_FSM 0x0002
238
+ #define TABLE_INSERT_FROZEN 0x0004
239
+ #define TABLE_INSERT_NO_LOGICAL 0x0008
240
+
241
+ /* flag bits for table_tuple_lock */
242
+ /* Follow tuples whose update is in progress if lock modes don't conflict */
243
+ #define TUPLE_LOCK_FLAG_LOCK_UPDATE_IN_PROGRESS (1 << 0)
244
+ /* Follow update chain and lock latest version of tuple */
245
+ #define TUPLE_LOCK_FLAG_FIND_LAST_VERSION (1 << 1)
246
+
247
+
248
+ /* Typedef for callback function for table_index_build_scan */
249
+ typedef void (*IndexBuildCallback) (Relation index,
250
+ ItemPointer tid,
251
+ Datum *values,
252
+ bool *isnull,
253
+ bool tupleIsAlive,
254
+ void *state);
255
+
256
+ /* Typedef for callback function for yb_table_index_build_scan */
257
+ typedef void (*YbIndexBuildCallback) (Relation index,
258
+ Datum ybctid,
259
+ Datum *values,
260
+ bool *isnull,
261
+ bool tupleIsAlive,
262
+ void *state);
263
+
264
+ /*
265
+ * API struct for a table AM. Note this must be allocated in a
266
+ * server-lifetime manner, typically as a static const struct, which then gets
267
+ * returned by FormData_pg_am.amhandler.
268
+ *
269
+ * In most cases it's not appropriate to call the callbacks directly, use the
270
+ * table_* wrapper functions instead.
271
+ *
272
+ * GetTableAmRoutine() asserts that required callbacks are filled in, remember
273
+ * to update when adding a callback.
274
+ */
275
+ typedef struct TableAmRoutine
276
+ {
277
+ /* this must be set to T_TableAmRoutine */
278
+ NodeTag type;
279
+
280
+
281
+ /* ------------------------------------------------------------------------
282
+ * Slot related callbacks.
283
+ * ------------------------------------------------------------------------
284
+ */
285
+
286
+ /*
287
+ * Return slot implementation suitable for storing a tuple of this AM.
288
+ */
289
+ const TupleTableSlotOps *(*slot_callbacks) (Relation rel);
290
+
291
+
292
+ /* ------------------------------------------------------------------------
293
+ * Table scan callbacks.
294
+ * ------------------------------------------------------------------------
295
+ */
296
+
297
+ /*
298
+ * Start a scan of `rel`. The callback has to return a TableScanDesc,
299
+ * which will typically be embedded in a larger, AM specific, struct.
300
+ *
301
+ * If nkeys != 0, the results need to be filtered by those scan keys.
302
+ *
303
+ * pscan, if not NULL, will have already been initialized with
304
+ * parallelscan_initialize(), and has to be for the same relation. Will
305
+ * only be set coming from table_beginscan_parallel().
306
+ *
307
+ * `flags` is a bitmask indicating the type of scan (ScanOptions's
308
+ * SO_TYPE_*, currently only one may be specified), options controlling
309
+ * the scan's behaviour (ScanOptions's SO_ALLOW_*, several may be
310
+ * specified, an AM may ignore unsupported ones) and whether the snapshot
311
+ * needs to be deallocated at scan_end (ScanOptions's SO_TEMP_SNAPSHOT).
312
+ */
313
+ TableScanDesc (*scan_begin) (Relation rel,
314
+ Snapshot snapshot,
315
+ int nkeys, struct ScanKeyData *key,
316
+ ParallelTableScanDesc pscan,
317
+ uint32 flags);
318
+
319
+ /*
320
+ * Release resources and deallocate scan. If TableScanDesc.temp_snap,
321
+ * TableScanDesc.rs_snapshot needs to be unregistered.
322
+ */
323
+ void (*scan_end) (TableScanDesc scan);
324
+
325
+ /*
326
+ * Restart relation scan. If set_params is set to true, allow_{strat,
327
+ * sync, pagemode} (see scan_begin) changes should be taken into account.
328
+ */
329
+ void (*scan_rescan) (TableScanDesc scan, struct ScanKeyData *key,
330
+ bool set_params, bool allow_strat,
331
+ bool allow_sync, bool allow_pagemode);
332
+
333
+ /*
334
+ * Return next tuple from `scan`, store in slot.
335
+ */
336
+ bool (*scan_getnextslot) (TableScanDesc scan,
337
+ ScanDirection direction,
338
+ TupleTableSlot *slot);
339
+
340
+ /*-----------
341
+ * Optional functions to provide scanning for ranges of ItemPointers.
342
+ * Implementations must either provide both of these functions, or neither
343
+ * of them.
344
+ *
345
+ * Implementations of scan_set_tidrange must themselves handle
346
+ * ItemPointers of any value. i.e, they must handle each of the following:
347
+ *
348
+ * 1) mintid or maxtid is beyond the end of the table; and
349
+ * 2) mintid is above maxtid; and
350
+ * 3) item offset for mintid or maxtid is beyond the maximum offset
351
+ * allowed by the AM.
352
+ *
353
+ * Implementations can assume that scan_set_tidrange is always called
354
+ * before can_getnextslot_tidrange or after scan_rescan and before any
355
+ * further calls to scan_getnextslot_tidrange.
356
+ */
357
+ void (*scan_set_tidrange) (TableScanDesc scan,
358
+ ItemPointer mintid,
359
+ ItemPointer maxtid);
360
+
361
+ /*
362
+ * Return next tuple from `scan` that's in the range of TIDs defined by
363
+ * scan_set_tidrange.
364
+ */
365
+ bool (*scan_getnextslot_tidrange) (TableScanDesc scan,
366
+ ScanDirection direction,
367
+ TupleTableSlot *slot);
368
+
369
+ /* ------------------------------------------------------------------------
370
+ * Parallel table scan related functions.
371
+ * ------------------------------------------------------------------------
372
+ */
373
+
374
+ /*
375
+ * Estimate the size of shared memory needed for a parallel scan of this
376
+ * relation. The snapshot does not need to be accounted for.
377
+ */
378
+ Size (*parallelscan_estimate) (Relation rel);
379
+
380
+ /*
381
+ * Initialize ParallelTableScanDesc for a parallel scan of this relation.
382
+ * `pscan` will be sized according to parallelscan_estimate() for the same
383
+ * relation.
384
+ */
385
+ Size (*parallelscan_initialize) (Relation rel,
386
+ ParallelTableScanDesc pscan);
387
+
388
+ /*
389
+ * Reinitialize `pscan` for a new scan. `rel` will be the same relation as
390
+ * when `pscan` was initialized by parallelscan_initialize.
391
+ */
392
+ void (*parallelscan_reinitialize) (Relation rel,
393
+ ParallelTableScanDesc pscan);
394
+
395
+
396
+ /* ------------------------------------------------------------------------
397
+ * Index Scan Callbacks
398
+ * ------------------------------------------------------------------------
399
+ */
400
+
401
+ /*
402
+ * Prepare to fetch tuples from the relation, as needed when fetching
403
+ * tuples for an index scan. The callback has to return an
404
+ * IndexFetchTableData, which the AM will typically embed in a larger
405
+ * structure with additional information.
406
+ *
407
+ * Tuples for an index scan can then be fetched via index_fetch_tuple.
408
+ */
409
+ struct IndexFetchTableData *(*index_fetch_begin) (Relation rel);
410
+
411
+ /*
412
+ * Reset index fetch. Typically this will release cross index fetch
413
+ * resources held in IndexFetchTableData.
414
+ */
415
+ void (*index_fetch_reset) (struct IndexFetchTableData *data);
416
+
417
+ /*
418
+ * Release resources and deallocate index fetch.
419
+ */
420
+ void (*index_fetch_end) (struct IndexFetchTableData *data);
421
+
422
+ /*
423
+ * Fetch tuple at `tid` into `slot`, after doing a visibility test
424
+ * according to `snapshot`. If a tuple was found and passed the visibility
425
+ * test, return true, false otherwise.
426
+ *
427
+ * Note that AMs that do not necessarily update indexes when indexed
428
+ * columns do not change, need to return the current/correct version of
429
+ * the tuple that is visible to the snapshot, even if the tid points to an
430
+ * older version of the tuple.
431
+ *
432
+ * *call_again is false on the first call to index_fetch_tuple for a tid.
433
+ * If there potentially is another tuple matching the tid, *call_again
434
+ * needs to be set to true by index_fetch_tuple, signaling to the caller
435
+ * that index_fetch_tuple should be called again for the same tid.
436
+ *
437
+ * *all_dead, if all_dead is not NULL, should be set to true by
438
+ * index_fetch_tuple iff it is guaranteed that no backend needs to see
439
+ * that tuple. Index AMs can use that to avoid returning that tid in
440
+ * future searches.
441
+ */
442
+ bool (*index_fetch_tuple) (struct IndexFetchTableData *scan,
443
+ ItemPointer tid,
444
+ Snapshot snapshot,
445
+ TupleTableSlot *slot,
446
+ bool *call_again, bool *all_dead);
447
+
448
+
449
+ /* ------------------------------------------------------------------------
450
+ * Callbacks for non-modifying operations on individual tuples
451
+ * ------------------------------------------------------------------------
452
+ */
453
+
454
+ /*
455
+ * Fetch tuple at `tid` into `slot`, after doing a visibility test
456
+ * according to `snapshot`. If a tuple was found and passed the visibility
457
+ * test, returns true, false otherwise.
458
+ */
459
+ bool (*tuple_fetch_row_version) (Relation rel,
460
+ ItemPointer tid,
461
+ Snapshot snapshot,
462
+ TupleTableSlot *slot);
463
+
464
+ /*
465
+ * Is tid valid for a scan of this relation.
466
+ */
467
+ bool (*tuple_tid_valid) (TableScanDesc scan,
468
+ ItemPointer tid);
469
+
470
+ /*
471
+ * Return the latest version of the tuple at `tid`, by updating `tid` to
472
+ * point at the newest version.
473
+ */
474
+ void (*tuple_get_latest_tid) (TableScanDesc scan,
475
+ ItemPointer tid);
476
+
477
+ /*
478
+ * Does the tuple in `slot` satisfy `snapshot`? The slot needs to be of
479
+ * the appropriate type for the AM.
480
+ */
481
+ bool (*tuple_satisfies_snapshot) (Relation rel,
482
+ TupleTableSlot *slot,
483
+ Snapshot snapshot);
484
+
485
+ /* see table_index_delete_tuples() */
486
+ TransactionId (*index_delete_tuples) (Relation rel,
487
+ TM_IndexDeleteOp *delstate);
488
+
489
+
490
+ /* ------------------------------------------------------------------------
491
+ * Manipulations of physical tuples.
492
+ * ------------------------------------------------------------------------
493
+ */
494
+
495
+ /* see table_tuple_insert() for reference about parameters */
496
+ void (*tuple_insert) (Relation rel, TupleTableSlot *slot,
497
+ CommandId cid, int options,
498
+ struct BulkInsertStateData *bistate);
499
+
500
+ /* see table_tuple_insert_speculative() for reference about parameters */
501
+ void (*tuple_insert_speculative) (Relation rel,
502
+ TupleTableSlot *slot,
503
+ CommandId cid,
504
+ int options,
505
+ struct BulkInsertStateData *bistate,
506
+ uint32 specToken);
507
+
508
+ /* see table_tuple_complete_speculative() for reference about parameters */
509
+ void (*tuple_complete_speculative) (Relation rel,
510
+ TupleTableSlot *slot,
511
+ uint32 specToken,
512
+ bool succeeded);
513
+
514
+ /* see table_multi_insert() for reference about parameters */
515
+ void (*multi_insert) (Relation rel, TupleTableSlot **slots, int nslots,
516
+ CommandId cid, int options, struct BulkInsertStateData *bistate);
517
+
518
+ /* see table_tuple_delete() for reference about parameters */
519
+ TM_Result (*tuple_delete) (Relation rel,
520
+ ItemPointer tid,
521
+ CommandId cid,
522
+ Snapshot snapshot,
523
+ Snapshot crosscheck,
524
+ bool wait,
525
+ TM_FailureData *tmfd,
526
+ bool changingPart);
527
+
528
+ /* see table_tuple_update() for reference about parameters */
529
+ TM_Result (*tuple_update) (Relation rel,
530
+ ItemPointer otid,
531
+ TupleTableSlot *slot,
532
+ CommandId cid,
533
+ Snapshot snapshot,
534
+ Snapshot crosscheck,
535
+ bool wait,
536
+ TM_FailureData *tmfd,
537
+ LockTupleMode *lockmode,
538
+ bool *update_indexes);
539
+
540
+ /* see table_tuple_lock() for reference about parameters */
541
+ TM_Result (*tuple_lock) (Relation rel,
542
+ ItemPointer tid,
543
+ Snapshot snapshot,
544
+ TupleTableSlot *slot,
545
+ CommandId cid,
546
+ LockTupleMode mode,
547
+ LockWaitPolicy wait_policy,
548
+ uint8 flags,
549
+ TM_FailureData *tmfd);
550
+
551
+ /*
552
+ * Perform operations necessary to complete insertions made via
553
+ * tuple_insert and multi_insert with a BulkInsertState specified. In-tree
554
+ * access methods ceased to use this.
555
+ *
556
+ * Typically callers of tuple_insert and multi_insert will just pass all
557
+ * the flags that apply to them, and each AM has to decide which of them
558
+ * make sense for it, and then only take actions in finish_bulk_insert for
559
+ * those flags, and ignore others.
560
+ *
561
+ * Optional callback.
562
+ */
563
+ void (*finish_bulk_insert) (Relation rel, int options);
564
+
565
+
566
+ /* ------------------------------------------------------------------------
567
+ * DDL related functionality.
568
+ * ------------------------------------------------------------------------
569
+ */
570
+
571
+ /*
572
+ * This callback needs to create a new relation filenode for `rel`, with
573
+ * appropriate durability behaviour for `persistence`.
574
+ *
575
+ * Note that only the subset of the relcache filled by
576
+ * RelationBuildLocalRelation() can be relied upon and that the relation's
577
+ * catalog entries will either not yet exist (new relation), or will still
578
+ * reference the old relfilenode.
579
+ *
580
+ * As output *freezeXid, *minmulti must be set to the values appropriate
581
+ * for pg_class.{relfrozenxid, relminmxid}. For AMs that don't need those
582
+ * fields to be filled they can be set to InvalidTransactionId and
583
+ * InvalidMultiXactId, respectively.
584
+ *
585
+ * See also table_relation_set_new_filenode().
586
+ */
587
+ void (*relation_set_new_filenode) (Relation rel,
588
+ const RelFileNode *newrnode,
589
+ char persistence,
590
+ TransactionId *freezeXid,
591
+ MultiXactId *minmulti);
592
+
593
+ /*
594
+ * This callback needs to remove all contents from `rel`'s current
595
+ * relfilenode. No provisions for transactional behaviour need to be made.
596
+ * Often this can be implemented by truncating the underlying storage to
597
+ * its minimal size.
598
+ *
599
+ * See also table_relation_nontransactional_truncate().
600
+ */
601
+ void (*relation_nontransactional_truncate) (Relation rel);
602
+
603
+ /*
604
+ * See table_relation_copy_data().
605
+ *
606
+ * This can typically be implemented by directly copying the underlying
607
+ * storage, unless it contains references to the tablespace internally.
608
+ */
609
+ void (*relation_copy_data) (Relation rel,
610
+ const RelFileNode *newrnode);
611
+
612
+ /* See table_relation_copy_for_cluster() */
613
+ void (*relation_copy_for_cluster) (Relation OldTable,
614
+ Relation NewTable,
615
+ Relation OldIndex,
616
+ bool use_sort,
617
+ TransactionId OldestXmin,
618
+ TransactionId *xid_cutoff,
619
+ MultiXactId *multi_cutoff,
620
+ double *num_tuples,
621
+ double *tups_vacuumed,
622
+ double *tups_recently_dead);
623
+
624
+ /*
625
+ * React to VACUUM command on the relation. The VACUUM can be triggered by
626
+ * a user or by autovacuum. The specific actions performed by the AM will
627
+ * depend heavily on the individual AM.
628
+ *
629
+ * On entry a transaction is already established, and the relation is
630
+ * locked with a ShareUpdateExclusive lock.
631
+ *
632
+ * Note that neither VACUUM FULL (and CLUSTER), nor ANALYZE go through
633
+ * this routine, even if (for ANALYZE) it is part of the same VACUUM
634
+ * command.
635
+ *
636
+ * There probably, in the future, needs to be a separate callback to
637
+ * integrate with autovacuum's scheduling.
638
+ */
639
+ void (*relation_vacuum) (Relation rel,
640
+ struct VacuumParams *params,
641
+ BufferAccessStrategy bstrategy);
642
+
643
+ /*
644
+ * Prepare to analyze block `blockno` of `scan`. The scan has been started
645
+ * with table_beginscan_analyze(). See also
646
+ * table_scan_analyze_next_block().
647
+ *
648
+ * The callback may acquire resources like locks that are held until
649
+ * table_scan_analyze_next_tuple() returns false. It e.g. can make sense
650
+ * to hold a lock until all tuples on a block have been analyzed by
651
+ * scan_analyze_next_tuple.
652
+ *
653
+ * The callback can return false if the block is not suitable for
654
+ * sampling, e.g. because it's a metapage that could never contain tuples.
655
+ *
656
+ * XXX: This obviously is primarily suited for block-based AMs. It's not
657
+ * clear what a good interface for non block based AMs would be, so there
658
+ * isn't one yet.
659
+ */
660
+ bool (*scan_analyze_next_block) (TableScanDesc scan,
661
+ BlockNumber blockno,
662
+ BufferAccessStrategy bstrategy);
663
+
664
+ /*
665
+ * See table_scan_analyze_next_tuple().
666
+ *
667
+ * Not every AM might have a meaningful concept of dead rows, in which
668
+ * case it's OK to not increment *deadrows - but note that that may
669
+ * influence autovacuum scheduling (see comment for relation_vacuum
670
+ * callback).
671
+ */
672
+ bool (*scan_analyze_next_tuple) (TableScanDesc scan,
673
+ TransactionId OldestXmin,
674
+ double *liverows,
675
+ double *deadrows,
676
+ TupleTableSlot *slot);
677
+
678
+ /* see table_index_build_range_scan for reference about parameters */
679
+ double (*index_build_range_scan) (Relation table_rel,
680
+ Relation index_rel,
681
+ struct IndexInfo *index_info,
682
+ bool allow_sync,
683
+ bool anyvisible,
684
+ bool progress,
685
+ BlockNumber start_blockno,
686
+ BlockNumber numblocks,
687
+ IndexBuildCallback callback,
688
+ void *callback_state,
689
+ TableScanDesc scan,
690
+ YbBackfillInfo *bfinfo,
691
+ YbPgExecOutParam *bfresult,
692
+ YbIndexBuildCallback ybcallback);
693
+
694
+ /* see table_index_validate_scan for reference about parameters */
695
+ void (*index_validate_scan) (Relation table_rel,
696
+ Relation index_rel,
697
+ struct IndexInfo *index_info,
698
+ Snapshot snapshot,
699
+ struct ValidateIndexState *state);
700
+
701
+
702
+ /* ------------------------------------------------------------------------
703
+ * Miscellaneous functions.
704
+ * ------------------------------------------------------------------------
705
+ */
706
+
707
+ /*
708
+ * See table_relation_size().
709
+ *
710
+ * Note that currently a few callers use the MAIN_FORKNUM size to figure
711
+ * out the range of potentially interesting blocks (brin, analyze). It's
712
+ * probable that we'll need to revise the interface for those at some
713
+ * point.
714
+ */
715
+ uint64 (*relation_size) (Relation rel, ForkNumber forkNumber);
716
+
717
+
718
+ /*
719
+ * This callback should return true if the relation requires a TOAST table
720
+ * and false if it does not. It may wish to examine the relation's tuple
721
+ * descriptor before making a decision, but if it uses some other method
722
+ * of storing large values (or if it does not support them) it can simply
723
+ * return false.
724
+ */
725
+ bool (*relation_needs_toast_table) (Relation rel);
726
+
727
+ /*
728
+ * This callback should return the OID of the table AM that implements
729
+ * TOAST tables for this AM. If the relation_needs_toast_table callback
730
+ * always returns false, this callback is not required.
731
+ */
732
+ Oid (*relation_toast_am) (Relation rel);
733
+
734
+ /*
735
+ * This callback is invoked when detoasting a value stored in a toast
736
+ * table implemented by this AM. See table_relation_fetch_toast_slice()
737
+ * for more details.
738
+ */
739
+ void (*relation_fetch_toast_slice) (Relation toastrel, Oid valueid,
740
+ int32 attrsize,
741
+ int32 sliceoffset,
742
+ int32 slicelength,
743
+ struct varlena *result);
744
+
745
+
746
+ /* ------------------------------------------------------------------------
747
+ * Planner related functions.
748
+ * ------------------------------------------------------------------------
749
+ */
750
+
751
+ /*
752
+ * See table_relation_estimate_size().
753
+ *
754
+ * While block oriented, it shouldn't be too hard for an AM that doesn't
755
+ * internally use blocks to convert into a usable representation.
756
+ *
757
+ * This differs from the relation_size callback by returning size
758
+ * estimates (both relation size and tuple count) for planning purposes,
759
+ * rather than returning a currently correct estimate.
760
+ */
761
+ void (*relation_estimate_size) (Relation rel, int32 *attr_widths,
762
+ BlockNumber *pages, double *tuples,
763
+ double *allvisfrac);
764
+
765
+
766
+ /* ------------------------------------------------------------------------
767
+ * Executor related functions.
768
+ * ------------------------------------------------------------------------
769
+ */
770
+
771
+ /*
772
+ * Prepare to fetch / check / return tuples from `tbmres->blockno` as part
773
+ * of a bitmap table scan. `scan` was started via table_beginscan_bm().
774
+ * Return false if there are no tuples to be found on the page, true
775
+ * otherwise.
776
+ *
777
+ * This will typically read and pin the target block, and do the necessary
778
+ * work to allow scan_bitmap_next_tuple() to return tuples (e.g. it might
779
+ * make sense to perform tuple visibility checks at this time). For some
780
+ * AMs it will make more sense to do all the work referencing `tbmres`
781
+ * contents here, for others it might be better to defer more work to
782
+ * scan_bitmap_next_tuple.
783
+ *
784
+ * If `tbmres->blockno` is -1, this is a lossy scan and all visible tuples
785
+ * on the page have to be returned, otherwise the tuples at offsets in
786
+ * `tbmres->offsets` need to be returned.
787
+ *
788
+ * XXX: Currently this may only be implemented if the AM uses md.c as its
789
+ * storage manager, and uses ItemPointer->ip_blkid in a manner that maps
790
+ * blockids directly to the underlying storage. nodeBitmapHeapscan.c
791
+ * performs prefetching directly using that interface. This probably
792
+ * needs to be rectified at a later point.
793
+ *
794
+ * XXX: Currently this may only be implemented if the AM uses the
795
+ * visibilitymap, as nodeBitmapHeapscan.c unconditionally accesses it to
796
+ * perform prefetching. This probably needs to be rectified at a later
797
+ * point.
798
+ *
799
+ * Optional callback, but either both scan_bitmap_next_block and
800
+ * scan_bitmap_next_tuple need to exist, or neither.
801
+ */
802
+ bool (*scan_bitmap_next_block) (TableScanDesc scan,
803
+ struct TBMIterateResult *tbmres);
804
+
805
+ /*
806
+ * Fetch the next tuple of a bitmap table scan into `slot` and return true
807
+ * if a visible tuple was found, false otherwise.
808
+ *
809
+ * For some AMs it will make more sense to do all the work referencing
810
+ * `tbmres` contents in scan_bitmap_next_block, for others it might be
811
+ * better to defer more work to this callback.
812
+ *
813
+ * Optional callback, but either both scan_bitmap_next_block and
814
+ * scan_bitmap_next_tuple need to exist, or neither.
815
+ */
816
+ bool (*scan_bitmap_next_tuple) (TableScanDesc scan,
817
+ struct TBMIterateResult *tbmres,
818
+ TupleTableSlot *slot);
819
+
820
+ /*
821
+ * Prepare to fetch tuples from the next block in a sample scan. Return
822
+ * false if the sample scan is finished, true otherwise. `scan` was
823
+ * started via table_beginscan_sampling().
824
+ *
825
+ * Typically this will first determine the target block by calling the
826
+ * TsmRoutine's NextSampleBlock() callback if not NULL, or alternatively
827
+ * perform a sequential scan over all blocks. The determined block is
828
+ * then typically read and pinned.
829
+ *
830
+ * As the TsmRoutine interface is block based, a block needs to be passed
831
+ * to NextSampleBlock(). If that's not appropriate for an AM, it
832
+ * internally needs to perform mapping between the internal and a block
833
+ * based representation.
834
+ *
835
+ * Note that it's not acceptable to hold deadlock prone resources such as
836
+ * lwlocks until scan_sample_next_tuple() has exhausted the tuples on the
837
+ * block - the tuple is likely to be returned to an upper query node, and
838
+ * the next call could be off a long while. Holding buffer pins and such
839
+ * is obviously OK.
840
+ *
841
+ * Currently it is required to implement this interface, as there's no
842
+ * alternative way (contrary e.g. to bitmap scans) to implement sample
843
+ * scans. If infeasible to implement, the AM may raise an error.
844
+ */
845
+ bool (*scan_sample_next_block) (TableScanDesc scan,
846
+ struct SampleScanState *scanstate);
847
+
848
+ /*
849
+ * This callback, only called after scan_sample_next_block has returned
850
+ * true, should determine the next tuple to be returned from the selected
851
+ * block using the TsmRoutine's NextSampleTuple() callback.
852
+ *
853
+ * The callback needs to perform visibility checks, and only return
854
+ * visible tuples. That obviously can mean calling NextSampleTuple()
855
+ * multiple times.
856
+ *
857
+ * The TsmRoutine interface assumes that there's a maximum offset on a
858
+ * given page, so if that doesn't apply to an AM, it needs to emulate that
859
+ * assumption somehow.
860
+ */
861
+ bool (*scan_sample_next_tuple) (TableScanDesc scan,
862
+ struct SampleScanState *scanstate,
863
+ TupleTableSlot *slot);
864
+
865
+ } TableAmRoutine;
866
+
867
+
868
+ /* ----------------------------------------------------------------------------
869
+ * Slot functions.
870
+ * ----------------------------------------------------------------------------
871
+ */
872
+
873
+ /*
874
+ * Returns slot callbacks suitable for holding tuples of the appropriate type
875
+ * for the relation. Works for tables, views, foreign tables and partitioned
876
+ * tables.
877
+ */
878
+ extern const TupleTableSlotOps *table_slot_callbacks(Relation rel);
879
+
880
+ /*
881
+ * Returns slot using the callbacks returned by table_slot_callbacks(), and
882
+ * registers it on *reglist.
883
+ */
884
+ extern TupleTableSlot *table_slot_create(Relation rel, List **reglist);
885
+
886
+
887
+ /* ----------------------------------------------------------------------------
888
+ * Table scan functions.
889
+ * ----------------------------------------------------------------------------
890
+ */
891
+
892
+ /*
893
+ * Start a scan of `rel`. Returned tuples pass a visibility test of
894
+ * `snapshot`, and if nkeys != 0, the results are filtered by those scan keys.
895
+ */
896
+ static inline TableScanDesc
897
+ table_beginscan(Relation rel, Snapshot snapshot,
898
+ int nkeys, struct ScanKeyData *key)
899
+ {
900
+ uint32 flags = SO_TYPE_SEQSCAN |
901
+ SO_ALLOW_STRAT | SO_ALLOW_SYNC | SO_ALLOW_PAGEMODE;
902
+
903
+ return rel->rd_tableam->scan_begin(rel, snapshot, nkeys, key, NULL, flags);
904
+ }
905
+
906
+ /*
907
+ * Like table_beginscan(), but for scanning catalog. It'll automatically use a
908
+ * snapshot appropriate for scanning catalog relations.
909
+ */
910
+ extern TableScanDesc table_beginscan_catalog(Relation rel, int nkeys,
911
+ struct ScanKeyData *key);
912
+
913
+ /*
914
+ * Like table_beginscan(), but table_beginscan_strat() offers an extended API
915
+ * that lets the caller control whether a nondefault buffer access strategy
916
+ * can be used, and whether syncscan can be chosen (possibly resulting in the
917
+ * scan not starting from block zero). Both of these default to true with
918
+ * plain table_beginscan.
919
+ */
920
+ static inline TableScanDesc
921
+ table_beginscan_strat(Relation rel, Snapshot snapshot,
922
+ int nkeys, struct ScanKeyData *key,
923
+ bool allow_strat, bool allow_sync)
924
+ {
925
+ uint32 flags = SO_TYPE_SEQSCAN | SO_ALLOW_PAGEMODE;
926
+
927
+ if (allow_strat)
928
+ flags |= SO_ALLOW_STRAT;
929
+ if (allow_sync)
930
+ flags |= SO_ALLOW_SYNC;
931
+
932
+ return rel->rd_tableam->scan_begin(rel, snapshot, nkeys, key, NULL, flags);
933
+ }
934
+
935
+ /*
936
+ * table_beginscan_bm is an alternative entry point for setting up a
937
+ * TableScanDesc for a bitmap heap scan. Although that scan technology is
938
+ * really quite unlike a standard seqscan, there is just enough commonality to
939
+ * make it worth using the same data structure.
940
+ */
941
+ static inline TableScanDesc
942
+ table_beginscan_bm(Relation rel, Snapshot snapshot,
943
+ int nkeys, struct ScanKeyData *key)
944
+ {
945
+ uint32 flags = SO_TYPE_BITMAPSCAN | SO_ALLOW_PAGEMODE;
946
+
947
+ return rel->rd_tableam->scan_begin(rel, snapshot, nkeys, key, NULL, flags);
948
+ }
949
+
950
+ /*
951
+ * table_beginscan_sampling is an alternative entry point for setting up a
952
+ * TableScanDesc for a TABLESAMPLE scan. As with bitmap scans, it's worth
953
+ * using the same data structure although the behavior is rather different.
954
+ * In addition to the options offered by table_beginscan_strat, this call
955
+ * also allows control of whether page-mode visibility checking is used.
956
+ */
957
+ static inline TableScanDesc
958
+ table_beginscan_sampling(Relation rel, Snapshot snapshot,
959
+ int nkeys, struct ScanKeyData *key,
960
+ bool allow_strat, bool allow_sync,
961
+ bool allow_pagemode)
962
+ {
963
+ uint32 flags = SO_TYPE_SAMPLESCAN;
964
+
965
+ if (allow_strat)
966
+ flags |= SO_ALLOW_STRAT;
967
+ if (allow_sync)
968
+ flags |= SO_ALLOW_SYNC;
969
+ if (allow_pagemode)
970
+ flags |= SO_ALLOW_PAGEMODE;
971
+
972
+ return rel->rd_tableam->scan_begin(rel, snapshot, nkeys, key, NULL, flags);
973
+ }
974
+
975
+ /*
976
+ * table_beginscan_tid is an alternative entry point for setting up a
977
+ * TableScanDesc for a Tid scan. As with bitmap scans, it's worth using
978
+ * the same data structure although the behavior is rather different.
979
+ */
980
+ static inline TableScanDesc
981
+ table_beginscan_tid(Relation rel, Snapshot snapshot)
982
+ {
983
+ uint32 flags = SO_TYPE_TIDSCAN;
984
+
985
+ return rel->rd_tableam->scan_begin(rel, snapshot, 0, NULL, NULL, flags);
986
+ }
987
+
988
+ /*
989
+ * table_beginscan_analyze is an alternative entry point for setting up a
990
+ * TableScanDesc for an ANALYZE scan. As with bitmap scans, it's worth using
991
+ * the same data structure although the behavior is rather different.
992
+ */
993
+ static inline TableScanDesc
994
+ table_beginscan_analyze(Relation rel)
995
+ {
996
+ uint32 flags = SO_TYPE_ANALYZE;
997
+
998
+ return rel->rd_tableam->scan_begin(rel, NULL, 0, NULL, NULL, flags);
999
+ }
1000
+
1001
+ /*
1002
+ * End relation scan.
1003
+ */
1004
+ static inline void
1005
+ table_endscan(TableScanDesc scan)
1006
+ {
1007
+ scan->rs_rd->rd_tableam->scan_end(scan);
1008
+ }
1009
+
1010
+ /*
1011
+ * Restart a relation scan.
1012
+ */
1013
+ static inline void
1014
+ table_rescan(TableScanDesc scan,
1015
+ struct ScanKeyData *key)
1016
+ {
1017
+ scan->rs_rd->rd_tableam->scan_rescan(scan, key, false, false, false, false);
1018
+ }
1019
+
1020
+ /*
1021
+ * Restart a relation scan after changing params.
1022
+ *
1023
+ * This call allows changing the buffer strategy, syncscan, and pagemode
1024
+ * options before starting a fresh scan. Note that although the actual use of
1025
+ * syncscan might change (effectively, enabling or disabling reporting), the
1026
+ * previously selected startblock will be kept.
1027
+ */
1028
+ static inline void
1029
+ table_rescan_set_params(TableScanDesc scan, struct ScanKeyData *key,
1030
+ bool allow_strat, bool allow_sync, bool allow_pagemode)
1031
+ {
1032
+ scan->rs_rd->rd_tableam->scan_rescan(scan, key, true,
1033
+ allow_strat, allow_sync,
1034
+ allow_pagemode);
1035
+ }
1036
+
1037
+ /*
1038
+ * Update snapshot used by the scan.
1039
+ */
1040
+ extern void table_scan_update_snapshot(TableScanDesc scan, Snapshot snapshot);
1041
+
1042
+ /*
1043
+ * Return next tuple from `scan`, store in slot.
1044
+ */
1045
+ static inline bool
1046
+ table_scan_getnextslot(TableScanDesc sscan, ScanDirection direction, TupleTableSlot *slot)
1047
+ {
1048
+ slot->tts_tableOid = RelationGetRelid(sscan->rs_rd);
1049
+
1050
+ /*
1051
+ * We don't expect direct calls to table_scan_getnextslot with valid
1052
+ * CheckXidAlive for catalog or regular tables. See detailed comments in
1053
+ * xact.c where these variables are declared.
1054
+ */
1055
+ if (unlikely(TransactionIdIsValid(CheckXidAlive) && !bsysscan))
1056
+ elog(ERROR, "unexpected table_scan_getnextslot call during logical decoding");
1057
+
1058
+ return sscan->rs_rd->rd_tableam->scan_getnextslot(sscan, direction, slot);
1059
+ }
1060
+
1061
+ /* ----------------------------------------------------------------------------
1062
+ * TID Range scanning related functions.
1063
+ * ----------------------------------------------------------------------------
1064
+ */
1065
+
1066
+ /*
1067
+ * table_beginscan_tidrange is the entry point for setting up a TableScanDesc
1068
+ * for a TID range scan.
1069
+ */
1070
+ static inline TableScanDesc
1071
+ table_beginscan_tidrange(Relation rel, Snapshot snapshot,
1072
+ ItemPointer mintid,
1073
+ ItemPointer maxtid)
1074
+ {
1075
+ TableScanDesc sscan;
1076
+ uint32 flags = SO_TYPE_TIDRANGESCAN | SO_ALLOW_PAGEMODE;
1077
+
1078
+ sscan = rel->rd_tableam->scan_begin(rel, snapshot, 0, NULL, NULL, flags);
1079
+
1080
+ /* Set the range of TIDs to scan */
1081
+ sscan->rs_rd->rd_tableam->scan_set_tidrange(sscan, mintid, maxtid);
1082
+
1083
+ return sscan;
1084
+ }
1085
+
1086
+ /*
1087
+ * table_rescan_tidrange resets the scan position and sets the minimum and
1088
+ * maximum TID range to scan for a TableScanDesc created by
1089
+ * table_beginscan_tidrange.
1090
+ */
1091
+ static inline void
1092
+ table_rescan_tidrange(TableScanDesc sscan, ItemPointer mintid,
1093
+ ItemPointer maxtid)
1094
+ {
1095
+ /* Ensure table_beginscan_tidrange() was used. */
1096
+ Assert((sscan->rs_flags & SO_TYPE_TIDRANGESCAN) != 0);
1097
+
1098
+ sscan->rs_rd->rd_tableam->scan_rescan(sscan, NULL, false, false, false, false);
1099
+ sscan->rs_rd->rd_tableam->scan_set_tidrange(sscan, mintid, maxtid);
1100
+ }
1101
+
1102
+ /*
1103
+ * Fetch the next tuple from `sscan` for a TID range scan created by
1104
+ * table_beginscan_tidrange(). Stores the tuple in `slot` and returns true,
1105
+ * or returns false if no more tuples exist in the range.
1106
+ */
1107
+ static inline bool
1108
+ table_scan_getnextslot_tidrange(TableScanDesc sscan, ScanDirection direction,
1109
+ TupleTableSlot *slot)
1110
+ {
1111
+ /* Ensure table_beginscan_tidrange() was used. */
1112
+ Assert((sscan->rs_flags & SO_TYPE_TIDRANGESCAN) != 0);
1113
+
1114
+ return sscan->rs_rd->rd_tableam->scan_getnextslot_tidrange(sscan,
1115
+ direction,
1116
+ slot);
1117
+ }
1118
+
1119
+
1120
+ /* ----------------------------------------------------------------------------
1121
+ * Parallel table scan related functions.
1122
+ * ----------------------------------------------------------------------------
1123
+ */
1124
+
1125
+ /*
1126
+ * Estimate the size of shared memory needed for a parallel scan of this
1127
+ * relation.
1128
+ */
1129
+ extern Size table_parallelscan_estimate(Relation rel, Snapshot snapshot);
1130
+
1131
+ /*
1132
+ * Initialize ParallelTableScanDesc for a parallel scan of this
1133
+ * relation. `pscan` needs to be sized according to parallelscan_estimate()
1134
+ * for the same relation. Call this just once in the leader process; then,
1135
+ * individual workers attach via table_beginscan_parallel.
1136
+ */
1137
+ extern void table_parallelscan_initialize(Relation rel,
1138
+ ParallelTableScanDesc pscan,
1139
+ Snapshot snapshot);
1140
+
1141
+ /*
1142
+ * Begin a parallel scan. `pscan` needs to have been initialized with
1143
+ * table_parallelscan_initialize(), for the same relation. The initialization
1144
+ * does not need to have happened in this backend.
1145
+ *
1146
+ * Caller must hold a suitable lock on the relation.
1147
+ */
1148
+ extern TableScanDesc table_beginscan_parallel(Relation rel,
1149
+ ParallelTableScanDesc pscan);
1150
+
1151
+ /*
1152
+ * Restart a parallel scan. Call this in the leader process. Caller is
1153
+ * responsible for making sure that all workers have finished the scan
1154
+ * beforehand.
1155
+ */
1156
+ static inline void
1157
+ table_parallelscan_reinitialize(Relation rel, ParallelTableScanDesc pscan)
1158
+ {
1159
+ rel->rd_tableam->parallelscan_reinitialize(rel, pscan);
1160
+ }
1161
+
1162
+
1163
+ /* ----------------------------------------------------------------------------
1164
+ * Index scan related functions.
1165
+ * ----------------------------------------------------------------------------
1166
+ */
1167
+
1168
+ /*
1169
+ * Prepare to fetch tuples from the relation, as needed when fetching tuples
1170
+ * for an index scan.
1171
+ *
1172
+ * Tuples for an index scan can then be fetched via table_index_fetch_tuple().
1173
+ */
1174
+ static inline IndexFetchTableData *
1175
+ table_index_fetch_begin(Relation rel)
1176
+ {
1177
+ return rel->rd_tableam->index_fetch_begin(rel);
1178
+ }
1179
+
1180
+ /*
1181
+ * Reset index fetch. Typically this will release cross index fetch resources
1182
+ * held in IndexFetchTableData.
1183
+ */
1184
+ static inline void
1185
+ table_index_fetch_reset(struct IndexFetchTableData *scan)
1186
+ {
1187
+ scan->rel->rd_tableam->index_fetch_reset(scan);
1188
+ }
1189
+
1190
+ /*
1191
+ * Release resources and deallocate index fetch.
1192
+ */
1193
+ static inline void
1194
+ table_index_fetch_end(struct IndexFetchTableData *scan)
1195
+ {
1196
+ scan->rel->rd_tableam->index_fetch_end(scan);
1197
+ }
1198
+
1199
+ /*
1200
+ * Fetches, as part of an index scan, tuple at `tid` into `slot`, after doing
1201
+ * a visibility test according to `snapshot`. If a tuple was found and passed
1202
+ * the visibility test, returns true, false otherwise. Note that *tid may be
1203
+ * modified when we return true (see later remarks on multiple row versions
1204
+ * reachable via a single index entry).
1205
+ *
1206
+ * *call_again needs to be false on the first call to table_index_fetch_tuple() for
1207
+ * a tid. If there potentially is another tuple matching the tid, *call_again
1208
+ * will be set to true, signaling that table_index_fetch_tuple() should be called
1209
+ * again for the same tid.
1210
+ *
1211
+ * *all_dead, if all_dead is not NULL, will be set to true by
1212
+ * table_index_fetch_tuple() iff it is guaranteed that no backend needs to see
1213
+ * that tuple. Index AMs can use that to avoid returning that tid in future
1214
+ * searches.
1215
+ *
1216
+ * The difference between this function and table_tuple_fetch_row_version()
1217
+ * is that this function returns the currently visible version of a row if
1218
+ * the AM supports storing multiple row versions reachable via a single index
1219
+ * entry (like heap's HOT). Whereas table_tuple_fetch_row_version() only
1220
+ * evaluates the tuple exactly at `tid`. Outside of index entry ->table tuple
1221
+ * lookups, table_tuple_fetch_row_version() is what's usually needed.
1222
+ */
1223
+ static inline bool
1224
+ table_index_fetch_tuple(struct IndexFetchTableData *scan,
1225
+ ItemPointer tid,
1226
+ Snapshot snapshot,
1227
+ TupleTableSlot *slot,
1228
+ bool *call_again, bool *all_dead)
1229
+ {
1230
+ /*
1231
+ * We don't expect direct calls to table_index_fetch_tuple with valid
1232
+ * CheckXidAlive for catalog or regular tables. See detailed comments in
1233
+ * xact.c where these variables are declared.
1234
+ */
1235
+ if (unlikely(TransactionIdIsValid(CheckXidAlive) && !bsysscan))
1236
+ elog(ERROR, "unexpected table_index_fetch_tuple call during logical decoding");
1237
+
1238
+ return scan->rel->rd_tableam->index_fetch_tuple(scan, tid, snapshot,
1239
+ slot, call_again,
1240
+ all_dead);
1241
+ }
1242
+
1243
+ /*
1244
+ * This is a convenience wrapper around table_index_fetch_tuple() which
1245
+ * returns whether there are table tuple items corresponding to an index
1246
+ * entry. This likely is only useful to verify if there's a conflict in a
1247
+ * unique index.
1248
+ */
1249
+ extern bool table_index_fetch_tuple_check(Relation rel,
1250
+ ItemPointer tid,
1251
+ Snapshot snapshot,
1252
+ bool *all_dead);
1253
+
1254
+
1255
+ /* ------------------------------------------------------------------------
1256
+ * Functions for non-modifying operations on individual tuples
1257
+ * ------------------------------------------------------------------------
1258
+ */
1259
+
1260
+
1261
+ /*
1262
+ * Fetch tuple at `tid` into `slot`, after doing a visibility test according to
1263
+ * `snapshot`. If a tuple was found and passed the visibility test, returns
1264
+ * true, false otherwise.
1265
+ *
1266
+ * See table_index_fetch_tuple's comment about what the difference between
1267
+ * these functions is. It is correct to use this function outside of index
1268
+ * entry->table tuple lookups.
1269
+ */
1270
+ static inline bool
1271
+ table_tuple_fetch_row_version(Relation rel,
1272
+ ItemPointer tid,
1273
+ Snapshot snapshot,
1274
+ TupleTableSlot *slot)
1275
+ {
1276
+ /*
1277
+ * We don't expect direct calls to table_tuple_fetch_row_version with
1278
+ * valid CheckXidAlive for catalog or regular tables. See detailed
1279
+ * comments in xact.c where these variables are declared.
1280
+ */
1281
+ if (unlikely(TransactionIdIsValid(CheckXidAlive) && !bsysscan))
1282
+ elog(ERROR, "unexpected table_tuple_fetch_row_version call during logical decoding");
1283
+
1284
+ return rel->rd_tableam->tuple_fetch_row_version(rel, tid, snapshot, slot);
1285
+ }
1286
+
1287
+ /*
1288
+ * Verify that `tid` is a potentially valid tuple identifier. That doesn't
1289
+ * mean that the pointed to row needs to exist or be visible, but that
1290
+ * attempting to fetch the row (e.g. with table_tuple_get_latest_tid() or
1291
+ * table_tuple_fetch_row_version()) should not error out if called with that
1292
+ * tid.
1293
+ *
1294
+ * `scan` needs to have been started via table_beginscan().
1295
+ */
1296
+ static inline bool
1297
+ table_tuple_tid_valid(TableScanDesc scan, ItemPointer tid)
1298
+ {
1299
+ return scan->rs_rd->rd_tableam->tuple_tid_valid(scan, tid);
1300
+ }
1301
+
1302
+ /*
1303
+ * Return the latest version of the tuple at `tid`, by updating `tid` to
1304
+ * point at the newest version.
1305
+ */
1306
+ extern void table_tuple_get_latest_tid(TableScanDesc scan, ItemPointer tid);
1307
+
1308
+ /*
1309
+ * Return true iff tuple in slot satisfies the snapshot.
1310
+ *
1311
+ * This assumes the slot's tuple is valid, and of the appropriate type for the
1312
+ * AM.
1313
+ *
1314
+ * Some AMs might modify the data underlying the tuple as a side-effect. If so
1315
+ * they ought to mark the relevant buffer dirty.
1316
+ */
1317
+ static inline bool
1318
+ table_tuple_satisfies_snapshot(Relation rel, TupleTableSlot *slot,
1319
+ Snapshot snapshot)
1320
+ {
1321
+ return rel->rd_tableam->tuple_satisfies_snapshot(rel, slot, snapshot);
1322
+ }
1323
+
1324
+ /*
1325
+ * Determine which index tuples are safe to delete based on their table TID.
1326
+ *
1327
+ * Determines which entries from index AM caller's TM_IndexDeleteOp state
1328
+ * point to vacuumable table tuples. Entries that are found by tableam to be
1329
+ * vacuumable are naturally safe for index AM to delete, and so get directly
1330
+ * marked as deletable. See comments above TM_IndexDelete and comments above
1331
+ * TM_IndexDeleteOp for full details.
1332
+ *
1333
+ * Returns a latestRemovedXid transaction ID that caller generally places in
1334
+ * its index deletion WAL record. This might be used during subsequent REDO
1335
+ * of the WAL record when in Hot Standby mode -- a recovery conflict for the
1336
+ * index deletion operation might be required on the standby.
1337
+ */
1338
+ static inline TransactionId
1339
+ table_index_delete_tuples(Relation rel, TM_IndexDeleteOp *delstate)
1340
+ {
1341
+ return rel->rd_tableam->index_delete_tuples(rel, delstate);
1342
+ }
1343
+
1344
+
1345
+ /* ----------------------------------------------------------------------------
1346
+ * Functions for manipulations of physical tuples.
1347
+ * ----------------------------------------------------------------------------
1348
+ */
1349
+
1350
+ /*
1351
+ * Insert a tuple from a slot into table AM routine.
1352
+ *
1353
+ * The options bitmask allows the caller to specify options that may change the
1354
+ * behaviour of the AM. The AM will ignore options that it does not support.
1355
+ *
1356
+ * If the TABLE_INSERT_SKIP_FSM option is specified, AMs are free to not reuse
1357
+ * free space in the relation. This can save some cycles when we know the
1358
+ * relation is new and doesn't contain useful amounts of free space.
1359
+ * TABLE_INSERT_SKIP_FSM is commonly passed directly to
1360
+ * RelationGetBufferForTuple. See that method for more information.
1361
+ *
1362
+ * TABLE_INSERT_FROZEN should only be specified for inserts into
1363
+ * relfilenodes created during the current subtransaction and when
1364
+ * there are no prior snapshots or pre-existing portals open.
1365
+ * This causes rows to be frozen, which is an MVCC violation and
1366
+ * requires explicit options chosen by user.
1367
+ *
1368
+ * TABLE_INSERT_NO_LOGICAL force-disables the emitting of logical decoding
1369
+ * information for the tuple. This should solely be used during table rewrites
1370
+ * where RelationIsLogicallyLogged(relation) is not yet accurate for the new
1371
+ * relation.
1372
+ *
1373
+ * Note that most of these options will be applied when inserting into the
1374
+ * heap's TOAST table, too, if the tuple requires any out-of-line data.
1375
+ *
1376
+ * The BulkInsertState object (if any; bistate can be NULL for default
1377
+ * behavior) is also just passed through to RelationGetBufferForTuple. If
1378
+ * `bistate` is provided, table_finish_bulk_insert() needs to be called.
1379
+ *
1380
+ * On return the slot's tts_tid and tts_tableOid are updated to reflect the
1381
+ * insertion. But note that any toasting of fields within the slot is NOT
1382
+ * reflected in the slots contents.
1383
+ */
1384
+ static inline void
1385
+ table_tuple_insert(Relation rel, TupleTableSlot *slot, CommandId cid,
1386
+ int options, struct BulkInsertStateData *bistate)
1387
+ {
1388
+ rel->rd_tableam->tuple_insert(rel, slot, cid, options,
1389
+ bistate);
1390
+ }
1391
+
1392
+ /*
1393
+ * Perform a "speculative insertion". These can be backed out afterwards
1394
+ * without aborting the whole transaction. Other sessions can wait for the
1395
+ * speculative insertion to be confirmed, turning it into a regular tuple, or
1396
+ * aborted, as if it never existed. Speculatively inserted tuples behave as
1397
+ * "value locks" of short duration, used to implement INSERT .. ON CONFLICT.
1398
+ *
1399
+ * A transaction having performed a speculative insertion has to either abort,
1400
+ * or finish the speculative insertion with
1401
+ * table_tuple_complete_speculative(succeeded = ...).
1402
+ */
1403
+ static inline void
1404
+ table_tuple_insert_speculative(Relation rel, TupleTableSlot *slot,
1405
+ CommandId cid, int options,
1406
+ struct BulkInsertStateData *bistate,
1407
+ uint32 specToken)
1408
+ {
1409
+ rel->rd_tableam->tuple_insert_speculative(rel, slot, cid, options,
1410
+ bistate, specToken);
1411
+ }
1412
+
1413
+ /*
1414
+ * Complete "speculative insertion" started in the same transaction. If
1415
+ * succeeded is true, the tuple is fully inserted, if false, it's removed.
1416
+ */
1417
+ static inline void
1418
+ table_tuple_complete_speculative(Relation rel, TupleTableSlot *slot,
1419
+ uint32 specToken, bool succeeded)
1420
+ {
1421
+ rel->rd_tableam->tuple_complete_speculative(rel, slot, specToken,
1422
+ succeeded);
1423
+ }
1424
+
1425
+ /*
1426
+ * Insert multiple tuples into a table.
1427
+ *
1428
+ * This is like table_tuple_insert(), but inserts multiple tuples in one
1429
+ * operation. That's often faster than calling table_tuple_insert() in a loop,
1430
+ * because e.g. the AM can reduce WAL logging and page locking overhead.
1431
+ *
1432
+ * Except for taking `nslots` tuples as input, and an array of TupleTableSlots
1433
+ * in `slots`, the parameters for table_multi_insert() are the same as for
1434
+ * table_tuple_insert().
1435
+ *
1436
+ * Note: this leaks memory into the current memory context. You can create a
1437
+ * temporary context before calling this, if that's a problem.
1438
+ */
1439
+ static inline void
1440
+ table_multi_insert(Relation rel, TupleTableSlot **slots, int nslots,
1441
+ CommandId cid, int options, struct BulkInsertStateData *bistate)
1442
+ {
1443
+ rel->rd_tableam->multi_insert(rel, slots, nslots,
1444
+ cid, options, bistate);
1445
+ }
1446
+
1447
+ /*
1448
+ * Delete a tuple.
1449
+ *
1450
+ * NB: do not call this directly unless prepared to deal with
1451
+ * concurrent-update conditions. Use simple_table_tuple_delete instead.
1452
+ *
1453
+ * Input parameters:
1454
+ * relation - table to be modified (caller must hold suitable lock)
1455
+ * tid - TID of tuple to be deleted
1456
+ * cid - delete command ID (used for visibility test, and stored into
1457
+ * cmax if successful)
1458
+ * crosscheck - if not InvalidSnapshot, also check tuple against this
1459
+ * wait - true if should wait for any conflicting update to commit/abort
1460
+ * Output parameters:
1461
+ * tmfd - filled in failure cases (see below)
1462
+ * changingPart - true iff the tuple is being moved to another partition
1463
+ * table due to an update of the partition key. Otherwise, false.
1464
+ *
1465
+ * Normal, successful return value is TM_Ok, which means we did actually
1466
+ * delete it. Failure return codes are TM_SelfModified, TM_Updated, and
1467
+ * TM_BeingModified (the last only possible if wait == false).
1468
+ *
1469
+ * In the failure cases, the routine fills *tmfd with the tuple's t_ctid,
1470
+ * t_xmax, and, if possible, t_cmax. See comments for struct
1471
+ * TM_FailureData for additional info.
1472
+ */
1473
+ static inline TM_Result
1474
+ table_tuple_delete(Relation rel, ItemPointer tid, CommandId cid,
1475
+ Snapshot snapshot, Snapshot crosscheck, bool wait,
1476
+ TM_FailureData *tmfd, bool changingPart)
1477
+ {
1478
+ return rel->rd_tableam->tuple_delete(rel, tid, cid,
1479
+ snapshot, crosscheck,
1480
+ wait, tmfd, changingPart);
1481
+ }
1482
+
1483
+ /*
1484
+ * Update a tuple.
1485
+ *
1486
+ * NB: do not call this directly unless you are prepared to deal with
1487
+ * concurrent-update conditions. Use simple_table_tuple_update instead.
1488
+ *
1489
+ * Input parameters:
1490
+ * relation - table to be modified (caller must hold suitable lock)
1491
+ * otid - TID of old tuple to be replaced
1492
+ * slot - newly constructed tuple data to store
1493
+ * cid - update command ID (used for visibility test, and stored into
1494
+ * cmax/cmin if successful)
1495
+ * crosscheck - if not InvalidSnapshot, also check old tuple against this
1496
+ * wait - true if should wait for any conflicting update to commit/abort
1497
+ * Output parameters:
1498
+ * tmfd - filled in failure cases (see below)
1499
+ * lockmode - filled with lock mode acquired on tuple
1500
+ * update_indexes - in success cases this is set to true if new index entries
1501
+ * are required for this tuple
1502
+ *
1503
+ * Normal, successful return value is TM_Ok, which means we did actually
1504
+ * update it. Failure return codes are TM_SelfModified, TM_Updated, and
1505
+ * TM_BeingModified (the last only possible if wait == false).
1506
+ *
1507
+ * On success, the slot's tts_tid and tts_tableOid are updated to match the new
1508
+ * stored tuple; in particular, slot->tts_tid is set to the TID where the
1509
+ * new tuple was inserted, and its HEAP_ONLY_TUPLE flag is set iff a HOT
1510
+ * update was done. However, any TOAST changes in the new tuple's
1511
+ * data are not reflected into *newtup.
1512
+ *
1513
+ * In the failure cases, the routine fills *tmfd with the tuple's t_ctid,
1514
+ * t_xmax, and, if possible, t_cmax. See comments for struct TM_FailureData
1515
+ * for additional info.
1516
+ */
1517
+ static inline TM_Result
1518
+ table_tuple_update(Relation rel, ItemPointer otid, TupleTableSlot *slot,
1519
+ CommandId cid, Snapshot snapshot, Snapshot crosscheck,
1520
+ bool wait, TM_FailureData *tmfd, LockTupleMode *lockmode,
1521
+ bool *update_indexes)
1522
+ {
1523
+ return rel->rd_tableam->tuple_update(rel, otid, slot,
1524
+ cid, snapshot, crosscheck,
1525
+ wait, tmfd,
1526
+ lockmode, update_indexes);
1527
+ }
1528
+
1529
+ /*
1530
+ * Lock a tuple in the specified mode.
1531
+ *
1532
+ * Input parameters:
1533
+ * relation: relation containing tuple (caller must hold suitable lock)
1534
+ * tid: TID of tuple to lock
1535
+ * snapshot: snapshot to use for visibility determinations
1536
+ * cid: current command ID (used for visibility test, and stored into
1537
+ * tuple's cmax if lock is successful)
1538
+ * mode: lock mode desired
1539
+ * wait_policy: what to do if tuple lock is not available
1540
+ * flags:
1541
+ * If TUPLE_LOCK_FLAG_LOCK_UPDATE_IN_PROGRESS, follow the update chain to
1542
+ * also lock descendant tuples if lock modes don't conflict.
1543
+ * If TUPLE_LOCK_FLAG_FIND_LAST_VERSION, follow the update chain and lock
1544
+ * latest version.
1545
+ *
1546
+ * Output parameters:
1547
+ * *slot: contains the target tuple
1548
+ * *tmfd: filled in failure cases (see below)
1549
+ *
1550
+ * Function result may be:
1551
+ * TM_Ok: lock was successfully acquired
1552
+ * TM_Invisible: lock failed because tuple was never visible to us
1553
+ * TM_SelfModified: lock failed because tuple updated by self
1554
+ * TM_Updated: lock failed because tuple updated by other xact
1555
+ * TM_Deleted: lock failed because tuple deleted by other xact
1556
+ * TM_WouldBlock: lock couldn't be acquired and wait_policy is skip
1557
+ *
1558
+ * In the failure cases other than TM_Invisible and TM_Deleted, the routine
1559
+ * fills *tmfd with the tuple's t_ctid, t_xmax, and, if possible, t_cmax. See
1560
+ * comments for struct TM_FailureData for additional info.
1561
+ */
1562
+ static inline TM_Result
1563
+ table_tuple_lock(Relation rel, ItemPointer tid, Snapshot snapshot,
1564
+ TupleTableSlot *slot, CommandId cid, LockTupleMode mode,
1565
+ LockWaitPolicy wait_policy, uint8 flags,
1566
+ TM_FailureData *tmfd)
1567
+ {
1568
+ return rel->rd_tableam->tuple_lock(rel, tid, snapshot, slot,
1569
+ cid, mode, wait_policy,
1570
+ flags, tmfd);
1571
+ }
1572
+
1573
+ /*
1574
+ * Perform operations necessary to complete insertions made via
1575
+ * tuple_insert and multi_insert with a BulkInsertState specified.
1576
+ */
1577
+ static inline void
1578
+ table_finish_bulk_insert(Relation rel, int options)
1579
+ {
1580
+ /* optional callback */
1581
+ if (rel->rd_tableam && rel->rd_tableam->finish_bulk_insert)
1582
+ rel->rd_tableam->finish_bulk_insert(rel, options);
1583
+ }
1584
+
1585
+
1586
+ /* ------------------------------------------------------------------------
1587
+ * DDL related functionality.
1588
+ * ------------------------------------------------------------------------
1589
+ */
1590
+
1591
+ /*
1592
+ * Create storage for `rel` in `newrnode`, with persistence set to
1593
+ * `persistence`.
1594
+ *
1595
+ * This is used both during relation creation and various DDL operations to
1596
+ * create a new relfilenode that can be filled from scratch. When creating
1597
+ * new storage for an existing relfilenode, this should be called before the
1598
+ * relcache entry has been updated.
1599
+ *
1600
+ * *freezeXid, *minmulti are set to the xid / multixact horizon for the table
1601
+ * that pg_class.{relfrozenxid, relminmxid} have to be set to.
1602
+ */
1603
+ static inline void
1604
+ table_relation_set_new_filenode(Relation rel,
1605
+ const RelFileNode *newrnode,
1606
+ char persistence,
1607
+ TransactionId *freezeXid,
1608
+ MultiXactId *minmulti)
1609
+ {
1610
+ rel->rd_tableam->relation_set_new_filenode(rel, newrnode, persistence,
1611
+ freezeXid, minmulti);
1612
+ }
1613
+
1614
+ /*
1615
+ * Remove all table contents from `rel`, in a non-transactional manner.
1616
+ * Non-transactional meaning that there's no need to support rollbacks. This
1617
+ * commonly only is used to perform truncations for relfilenodes created in the
1618
+ * current transaction.
1619
+ */
1620
+ static inline void
1621
+ table_relation_nontransactional_truncate(Relation rel)
1622
+ {
1623
+ rel->rd_tableam->relation_nontransactional_truncate(rel);
1624
+ }
1625
+
1626
+ /*
1627
+ * Copy data from `rel` into the new relfilenode `newrnode`. The new
1628
+ * relfilenode may not have storage associated before this function is
1629
+ * called. This is only supposed to be used for low level operations like
1630
+ * changing a relation's tablespace.
1631
+ */
1632
+ static inline void
1633
+ table_relation_copy_data(Relation rel, const RelFileNode *newrnode)
1634
+ {
1635
+ rel->rd_tableam->relation_copy_data(rel, newrnode);
1636
+ }
1637
+
1638
+ /*
1639
+ * Copy data from `OldTable` into `NewTable`, as part of a CLUSTER or VACUUM
1640
+ * FULL.
1641
+ *
1642
+ * Additional Input parameters:
1643
+ * - use_sort - if true, the table contents are sorted appropriate for
1644
+ * `OldIndex`; if false and OldIndex is not InvalidOid, the data is copied
1645
+ * in that index's order; if false and OldIndex is InvalidOid, no sorting is
1646
+ * performed
1647
+ * - OldIndex - see use_sort
1648
+ * - OldestXmin - computed by vacuum_set_xid_limits(), even when
1649
+ * not needed for the relation's AM
1650
+ * - *xid_cutoff - ditto
1651
+ * - *multi_cutoff - ditto
1652
+ *
1653
+ * Output parameters:
1654
+ * - *xid_cutoff - rel's new relfrozenxid value, may be invalid
1655
+ * - *multi_cutoff - rel's new relminmxid value, may be invalid
1656
+ * - *tups_vacuumed - stats, for logging, if appropriate for AM
1657
+ * - *tups_recently_dead - stats, for logging, if appropriate for AM
1658
+ */
1659
+ static inline void
1660
+ table_relation_copy_for_cluster(Relation OldTable, Relation NewTable,
1661
+ Relation OldIndex,
1662
+ bool use_sort,
1663
+ TransactionId OldestXmin,
1664
+ TransactionId *xid_cutoff,
1665
+ MultiXactId *multi_cutoff,
1666
+ double *num_tuples,
1667
+ double *tups_vacuumed,
1668
+ double *tups_recently_dead)
1669
+ {
1670
+ OldTable->rd_tableam->relation_copy_for_cluster(OldTable, NewTable, OldIndex,
1671
+ use_sort, OldestXmin,
1672
+ xid_cutoff, multi_cutoff,
1673
+ num_tuples, tups_vacuumed,
1674
+ tups_recently_dead);
1675
+ }
1676
+
1677
+ /*
1678
+ * Perform VACUUM on the relation. The VACUUM can be triggered by a user or by
1679
+ * autovacuum. The specific actions performed by the AM will depend heavily on
1680
+ * the individual AM.
1681
+ *
1682
+ * On entry a transaction needs to already been established, and the
1683
+ * table is locked with a ShareUpdateExclusive lock.
1684
+ *
1685
+ * Note that neither VACUUM FULL (and CLUSTER), nor ANALYZE go through this
1686
+ * routine, even if (for ANALYZE) it is part of the same VACUUM command.
1687
+ */
1688
+ static inline void
1689
+ table_relation_vacuum(Relation rel, struct VacuumParams *params,
1690
+ BufferAccessStrategy bstrategy)
1691
+ {
1692
+ rel->rd_tableam->relation_vacuum(rel, params, bstrategy);
1693
+ }
1694
+
1695
+ /*
1696
+ * Prepare to analyze block `blockno` of `scan`. The scan needs to have been
1697
+ * started with table_beginscan_analyze(). Note that this routine might
1698
+ * acquire resources like locks that are held until
1699
+ * table_scan_analyze_next_tuple() returns false.
1700
+ *
1701
+ * Returns false if block is unsuitable for sampling, true otherwise.
1702
+ */
1703
+ static inline bool
1704
+ table_scan_analyze_next_block(TableScanDesc scan, BlockNumber blockno,
1705
+ BufferAccessStrategy bstrategy)
1706
+ {
1707
+ return scan->rs_rd->rd_tableam->scan_analyze_next_block(scan, blockno,
1708
+ bstrategy);
1709
+ }
1710
+
1711
+ /*
1712
+ * Iterate over tuples in the block selected with
1713
+ * table_scan_analyze_next_block() (which needs to have returned true, and
1714
+ * this routine may not have returned false for the same block before). If a
1715
+ * tuple that's suitable for sampling is found, true is returned and a tuple
1716
+ * is stored in `slot`.
1717
+ *
1718
+ * *liverows and *deadrows are incremented according to the encountered
1719
+ * tuples.
1720
+ */
1721
+ static inline bool
1722
+ table_scan_analyze_next_tuple(TableScanDesc scan, TransactionId OldestXmin,
1723
+ double *liverows, double *deadrows,
1724
+ TupleTableSlot *slot)
1725
+ {
1726
+ return scan->rs_rd->rd_tableam->scan_analyze_next_tuple(scan, OldestXmin,
1727
+ liverows, deadrows,
1728
+ slot);
1729
+ }
1730
+
1731
+ /*
1732
+ * table_index_build_scan - scan the table to find tuples to be indexed
1733
+ *
1734
+ * This is called back from an access-method-specific index build procedure
1735
+ * after the AM has done whatever setup it needs. The parent table relation
1736
+ * is scanned to find tuples that should be entered into the index. Each
1737
+ * such tuple is passed to the AM's callback routine, which does the right
1738
+ * things to add it to the new index. After we return, the AM's index
1739
+ * build procedure does whatever cleanup it needs.
1740
+ *
1741
+ * The total count of live tuples is returned. This is for updating pg_class
1742
+ * statistics. (It's annoying not to be able to do that here, but we want to
1743
+ * merge that update with others; see index_update_stats.) Note that the
1744
+ * index AM itself must keep track of the number of index tuples; we don't do
1745
+ * so here because the AM might reject some of the tuples for its own reasons,
1746
+ * such as being unable to store NULLs.
1747
+ *
1748
+ * If 'progress', the PROGRESS_SCAN_BLOCKS_TOTAL counter is updated when
1749
+ * starting the scan, and PROGRESS_SCAN_BLOCKS_DONE is updated as we go along.
1750
+ *
1751
+ * A side effect is to set indexInfo->ii_BrokenHotChain to true if we detect
1752
+ * any potentially broken HOT chains. Currently, we set this if there are any
1753
+ * RECENTLY_DEAD or DELETE_IN_PROGRESS entries in a HOT chain, without trying
1754
+ * very hard to detect whether they're really incompatible with the chain tip.
1755
+ * This only really makes sense for heap AM, it might need to be generalized
1756
+ * for other AMs later.
1757
+ */
1758
+ static inline double
1759
+ table_index_build_scan(Relation table_rel,
1760
+ Relation index_rel,
1761
+ struct IndexInfo *index_info,
1762
+ bool allow_sync,
1763
+ bool progress,
1764
+ IndexBuildCallback callback,
1765
+ void *callback_state,
1766
+ TableScanDesc scan)
1767
+ {
1768
+ return table_rel->rd_tableam->index_build_range_scan(table_rel,
1769
+ index_rel,
1770
+ index_info,
1771
+ allow_sync,
1772
+ false,
1773
+ progress,
1774
+ 0,
1775
+ InvalidBlockNumber,
1776
+ callback,
1777
+ callback_state,
1778
+ scan,
1779
+ NULL, /* bfinfo */
1780
+ NULL, /* bfresult */
1781
+ NULL /* ybcallback */ );
1782
+ }
1783
+
1784
+ /*
1785
+ * YB variant of table_index_build_scan. Differences:
1786
+ * - use YbIndexBuildCallback, not IndexBuildCallback
1787
+ * - skip progress argument
1788
+ */
1789
+ static inline double
1790
+ yb_table_index_build_scan(Relation table_rel,
1791
+ Relation index_rel,
1792
+ struct IndexInfo *index_info,
1793
+ bool allow_sync,
1794
+ YbIndexBuildCallback ybcallback,
1795
+ void *callback_state,
1796
+ TableScanDesc scan)
1797
+ {
1798
+ return table_rel->rd_tableam->index_build_range_scan(table_rel,
1799
+ index_rel,
1800
+ index_info,
1801
+ allow_sync,
1802
+ false,
1803
+ false, /* progress */
1804
+ 0,
1805
+ InvalidBlockNumber,
1806
+ NULL, /* callback */
1807
+ callback_state,
1808
+ scan,
1809
+ NULL, /* bfinfo */
1810
+ NULL, /* bfresult */
1811
+ ybcallback);
1812
+ }
1813
+
1814
+ /*
1815
+ * As table_index_build_scan(), except that instead of scanning the complete
1816
+ * table, only the given number of blocks are scanned. Scan to end-of-rel can
1817
+ * be signaled by passing InvalidBlockNumber as numblocks. Note that
1818
+ * restricting the range to scan cannot be done when requesting syncscan.
1819
+ *
1820
+ * When "anyvisible" mode is requested, all tuples visible to any transaction
1821
+ * are indexed and counted as live, including those inserted or deleted by
1822
+ * transactions that are still in progress.
1823
+ */
1824
+ static inline double
1825
+ table_index_build_range_scan(Relation table_rel,
1826
+ Relation index_rel,
1827
+ struct IndexInfo *index_info,
1828
+ bool allow_sync,
1829
+ bool anyvisible,
1830
+ bool progress,
1831
+ BlockNumber start_blockno,
1832
+ BlockNumber numblocks,
1833
+ IndexBuildCallback callback,
1834
+ void *callback_state,
1835
+ TableScanDesc scan,
1836
+ YbBackfillInfo *bfinfo,
1837
+ YbPgExecOutParam *bfresult)
1838
+ {
1839
+ return table_rel->rd_tableam->index_build_range_scan(table_rel,
1840
+ index_rel,
1841
+ index_info,
1842
+ allow_sync,
1843
+ anyvisible,
1844
+ progress,
1845
+ start_blockno,
1846
+ numblocks,
1847
+ callback,
1848
+ callback_state,
1849
+ scan,
1850
+ bfinfo,
1851
+ bfresult,
1852
+ NULL /* ybcallback */ );
1853
+ }
1854
+
1855
+ /*
1856
+ * table_index_validate_scan - second table scan for concurrent index build
1857
+ *
1858
+ * See validate_index() for an explanation.
1859
+ */
1860
+ static inline void
1861
+ table_index_validate_scan(Relation table_rel,
1862
+ Relation index_rel,
1863
+ struct IndexInfo *index_info,
1864
+ Snapshot snapshot,
1865
+ struct ValidateIndexState *state)
1866
+ {
1867
+ table_rel->rd_tableam->index_validate_scan(table_rel,
1868
+ index_rel,
1869
+ index_info,
1870
+ snapshot,
1871
+ state);
1872
+ }
1873
+
1874
+
1875
+ /* ----------------------------------------------------------------------------
1876
+ * Miscellaneous functionality
1877
+ * ----------------------------------------------------------------------------
1878
+ */
1879
+
1880
+ /*
1881
+ * Return the current size of `rel` in bytes. If `forkNumber` is
1882
+ * InvalidForkNumber, return the relation's overall size, otherwise the size
1883
+ * for the indicated fork.
1884
+ *
1885
+ * Note that the overall size might not be the equivalent of the sum of sizes
1886
+ * for the individual forks for some AMs, e.g. because the AMs storage does
1887
+ * not neatly map onto the builtin types of forks.
1888
+ */
1889
+ static inline uint64
1890
+ table_relation_size(Relation rel, ForkNumber forkNumber)
1891
+ {
1892
+ return rel->rd_tableam->relation_size(rel, forkNumber);
1893
+ }
1894
+
1895
+ /*
1896
+ * table_relation_needs_toast_table - does this relation need a toast table?
1897
+ */
1898
+ static inline bool
1899
+ table_relation_needs_toast_table(Relation rel)
1900
+ {
1901
+ return rel->rd_tableam->relation_needs_toast_table(rel);
1902
+ }
1903
+
1904
+ /*
1905
+ * Return the OID of the AM that should be used to implement the TOAST table
1906
+ * for this relation.
1907
+ */
1908
+ static inline Oid
1909
+ table_relation_toast_am(Relation rel)
1910
+ {
1911
+ return rel->rd_tableam->relation_toast_am(rel);
1912
+ }
1913
+
1914
+ /*
1915
+ * Fetch all or part of a TOAST value from a TOAST table.
1916
+ *
1917
+ * If this AM is never used to implement a TOAST table, then this callback
1918
+ * is not needed. But, if toasted values are ever stored in a table of this
1919
+ * type, then you will need this callback.
1920
+ *
1921
+ * toastrel is the relation in which the toasted value is stored.
1922
+ *
1923
+ * valueid identifes which toast value is to be fetched. For the heap,
1924
+ * this corresponds to the values stored in the chunk_id column.
1925
+ *
1926
+ * attrsize is the total size of the toast value to be fetched.
1927
+ *
1928
+ * sliceoffset is the offset within the toast value of the first byte that
1929
+ * should be fetched.
1930
+ *
1931
+ * slicelength is the number of bytes from the toast value that should be
1932
+ * fetched.
1933
+ *
1934
+ * result is caller-allocated space into which the fetched bytes should be
1935
+ * stored.
1936
+ */
1937
+ static inline void
1938
+ table_relation_fetch_toast_slice(Relation toastrel, Oid valueid,
1939
+ int32 attrsize, int32 sliceoffset,
1940
+ int32 slicelength, struct varlena *result)
1941
+ {
1942
+ toastrel->rd_tableam->relation_fetch_toast_slice(toastrel, valueid,
1943
+ attrsize,
1944
+ sliceoffset, slicelength,
1945
+ result);
1946
+ }
1947
+
1948
+
1949
+ /* ----------------------------------------------------------------------------
1950
+ * Planner related functionality
1951
+ * ----------------------------------------------------------------------------
1952
+ */
1953
+
1954
+ /*
1955
+ * Estimate the current size of the relation, as an AM specific workhorse for
1956
+ * estimate_rel_size(). Look there for an explanation of the parameters.
1957
+ */
1958
+ static inline void
1959
+ table_relation_estimate_size(Relation rel, int32 *attr_widths,
1960
+ BlockNumber *pages, double *tuples,
1961
+ double *allvisfrac)
1962
+ {
1963
+ rel->rd_tableam->relation_estimate_size(rel, attr_widths, pages, tuples,
1964
+ allvisfrac);
1965
+ }
1966
+
1967
+
1968
+ /* ----------------------------------------------------------------------------
1969
+ * Executor related functionality
1970
+ * ----------------------------------------------------------------------------
1971
+ */
1972
+
1973
+ /*
1974
+ * Prepare to fetch / check / return tuples from `tbmres->blockno` as part of
1975
+ * a bitmap table scan. `scan` needs to have been started via
1976
+ * table_beginscan_bm(). Returns false if there are no tuples to be found on
1977
+ * the page, true otherwise.
1978
+ *
1979
+ * Note, this is an optionally implemented function, therefore should only be
1980
+ * used after verifying the presence (at plan time or such).
1981
+ */
1982
+ static inline bool
1983
+ table_scan_bitmap_next_block(TableScanDesc scan,
1984
+ struct TBMIterateResult *tbmres)
1985
+ {
1986
+ /*
1987
+ * We don't expect direct calls to table_scan_bitmap_next_block with valid
1988
+ * CheckXidAlive for catalog or regular tables. See detailed comments in
1989
+ * xact.c where these variables are declared.
1990
+ */
1991
+ if (unlikely(TransactionIdIsValid(CheckXidAlive) && !bsysscan))
1992
+ elog(ERROR, "unexpected table_scan_bitmap_next_block call during logical decoding");
1993
+
1994
+ return scan->rs_rd->rd_tableam->scan_bitmap_next_block(scan,
1995
+ tbmres);
1996
+ }
1997
+
1998
+ /*
1999
+ * Fetch the next tuple of a bitmap table scan into `slot` and return true if
2000
+ * a visible tuple was found, false otherwise.
2001
+ * table_scan_bitmap_next_block() needs to previously have selected a
2002
+ * block (i.e. returned true), and no previous
2003
+ * table_scan_bitmap_next_tuple() for the same block may have
2004
+ * returned false.
2005
+ */
2006
+ static inline bool
2007
+ table_scan_bitmap_next_tuple(TableScanDesc scan,
2008
+ struct TBMIterateResult *tbmres,
2009
+ TupleTableSlot *slot)
2010
+ {
2011
+ /*
2012
+ * We don't expect direct calls to table_scan_bitmap_next_tuple with valid
2013
+ * CheckXidAlive for catalog or regular tables. See detailed comments in
2014
+ * xact.c where these variables are declared.
2015
+ */
2016
+ if (unlikely(TransactionIdIsValid(CheckXidAlive) && !bsysscan))
2017
+ elog(ERROR, "unexpected table_scan_bitmap_next_tuple call during logical decoding");
2018
+
2019
+ return scan->rs_rd->rd_tableam->scan_bitmap_next_tuple(scan,
2020
+ tbmres,
2021
+ slot);
2022
+ }
2023
+
2024
+ /*
2025
+ * Prepare to fetch tuples from the next block in a sample scan. Returns false
2026
+ * if the sample scan is finished, true otherwise. `scan` needs to have been
2027
+ * started via table_beginscan_sampling().
2028
+ *
2029
+ * This will call the TsmRoutine's NextSampleBlock() callback if necessary
2030
+ * (i.e. NextSampleBlock is not NULL), or perform a sequential scan over the
2031
+ * underlying relation.
2032
+ */
2033
+ static inline bool
2034
+ table_scan_sample_next_block(TableScanDesc scan,
2035
+ struct SampleScanState *scanstate)
2036
+ {
2037
+ /*
2038
+ * We don't expect direct calls to table_scan_sample_next_block with valid
2039
+ * CheckXidAlive for catalog or regular tables. See detailed comments in
2040
+ * xact.c where these variables are declared.
2041
+ */
2042
+ if (unlikely(TransactionIdIsValid(CheckXidAlive) && !bsysscan))
2043
+ elog(ERROR, "unexpected table_scan_sample_next_block call during logical decoding");
2044
+ return scan->rs_rd->rd_tableam->scan_sample_next_block(scan, scanstate);
2045
+ }
2046
+
2047
+ /*
2048
+ * Fetch the next sample tuple into `slot` and return true if a visible tuple
2049
+ * was found, false otherwise. table_scan_sample_next_block() needs to
2050
+ * previously have selected a block (i.e. returned true), and no previous
2051
+ * table_scan_sample_next_tuple() for the same block may have returned false.
2052
+ *
2053
+ * This will call the TsmRoutine's NextSampleTuple() callback.
2054
+ */
2055
+ static inline bool
2056
+ table_scan_sample_next_tuple(TableScanDesc scan,
2057
+ struct SampleScanState *scanstate,
2058
+ TupleTableSlot *slot)
2059
+ {
2060
+ /*
2061
+ * We don't expect direct calls to table_scan_sample_next_tuple with valid
2062
+ * CheckXidAlive for catalog or regular tables. See detailed comments in
2063
+ * xact.c where these variables are declared.
2064
+ */
2065
+ if (unlikely(TransactionIdIsValid(CheckXidAlive) && !bsysscan))
2066
+ elog(ERROR, "unexpected table_scan_sample_next_tuple call during logical decoding");
2067
+ return scan->rs_rd->rd_tableam->scan_sample_next_tuple(scan, scanstate,
2068
+ slot);
2069
+ }
2070
+
2071
+
2072
+ /* ----------------------------------------------------------------------------
2073
+ * Functions to make modifications a bit simpler.
2074
+ * ----------------------------------------------------------------------------
2075
+ */
2076
+
2077
+ extern void simple_table_tuple_insert(Relation rel, TupleTableSlot *slot);
2078
+ extern void simple_table_tuple_delete(Relation rel, ItemPointer tid,
2079
+ Snapshot snapshot);
2080
+ extern void simple_table_tuple_update(Relation rel, ItemPointer otid,
2081
+ TupleTableSlot *slot, Snapshot snapshot,
2082
+ bool *update_indexes);
2083
+
2084
+
2085
+ /* ----------------------------------------------------------------------------
2086
+ * Helper functions to implement parallel scans for block oriented AMs.
2087
+ * ----------------------------------------------------------------------------
2088
+ */
2089
+
2090
+ extern Size table_block_parallelscan_estimate(Relation rel);
2091
+ extern Size table_block_parallelscan_initialize(Relation rel,
2092
+ ParallelTableScanDesc pscan);
2093
+ extern void table_block_parallelscan_reinitialize(Relation rel,
2094
+ ParallelTableScanDesc pscan);
2095
+ extern BlockNumber table_block_parallelscan_nextpage(Relation rel,
2096
+ ParallelBlockTableScanWorker pbscanwork,
2097
+ ParallelBlockTableScanDesc pbscan);
2098
+ extern void table_block_parallelscan_startblock_init(Relation rel,
2099
+ ParallelBlockTableScanWorker pbscanwork,
2100
+ ParallelBlockTableScanDesc pbscan);
2101
+
2102
+
2103
+ /* ----------------------------------------------------------------------------
2104
+ * Helper functions to implement relation sizing for block oriented AMs.
2105
+ * ----------------------------------------------------------------------------
2106
+ */
2107
+
2108
+ extern uint64 table_block_relation_size(Relation rel, ForkNumber forkNumber);
2109
+ extern void table_block_relation_estimate_size(Relation rel,
2110
+ int32 *attr_widths,
2111
+ BlockNumber *pages,
2112
+ double *tuples,
2113
+ double *allvisfrac,
2114
+ Size overhead_bytes_per_tuple,
2115
+ Size usable_bytes_per_page);
2116
+
2117
+ /* ----------------------------------------------------------------------------
2118
+ * Functions in tableamapi.c
2119
+ * ----------------------------------------------------------------------------
2120
+ */
2121
+
2122
+ extern const TableAmRoutine *GetTableAmRoutine(Oid amhandler);
2123
+ extern const TableAmRoutine *GetHeapamTableAmRoutine(void);
2124
+ extern bool check_default_table_access_method(char **newval, void **extra,
2125
+ GucSource source);
2126
+
2127
+ #endif /* TABLEAM_H */