pg_query 5.0.0 → 6.0.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 (898) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +27 -0
  3. data/README.md +1 -1
  4. data/Rakefile +3 -4
  5. data/ext/pg_query/extconf.rb +14 -4
  6. data/ext/pg_query/include/pg_query.h +4 -3
  7. data/ext/pg_query/include/pg_query_enum_defs.c +424 -154
  8. data/ext/pg_query/include/pg_query_fingerprint_conds.c +68 -4
  9. data/ext/pg_query/include/pg_query_fingerprint_defs.c +2901 -1794
  10. data/ext/pg_query/include/pg_query_outfuncs_conds.c +51 -3
  11. data/ext/pg_query/include/pg_query_outfuncs_defs.c +211 -24
  12. data/ext/pg_query/include/pg_query_readfuncs_conds.c +17 -1
  13. data/ext/pg_query/include/pg_query_readfuncs_defs.c +272 -53
  14. data/ext/pg_query/include/postgres/access/amapi.h +299 -0
  15. data/ext/pg_query/include/postgres/access/attmap.h +54 -0
  16. data/ext/pg_query/include/postgres/access/attnum.h +64 -0
  17. data/ext/pg_query/include/postgres/access/brin_internal.h +116 -0
  18. data/ext/pg_query/include/postgres/access/brin_tuple.h +112 -0
  19. data/ext/pg_query/include/postgres/access/clog.h +62 -0
  20. data/ext/pg_query/include/postgres/access/commit_ts.h +73 -0
  21. data/ext/pg_query/include/postgres/access/detoast.h +82 -0
  22. data/ext/pg_query/include/postgres/access/genam.h +237 -0
  23. data/ext/pg_query/include/postgres/access/gin.h +91 -0
  24. data/ext/pg_query/include/postgres/access/htup.h +89 -0
  25. data/ext/pg_query/include/postgres/access/htup_details.h +811 -0
  26. data/ext/pg_query/include/postgres/access/itup.h +170 -0
  27. data/ext/pg_query/include/postgres/access/parallel.h +81 -0
  28. data/ext/pg_query/include/postgres/access/printtup.h +35 -0
  29. data/ext/pg_query/include/postgres/access/relation.h +28 -0
  30. data/ext/pg_query/include/postgres/access/relscan.h +191 -0
  31. data/ext/pg_query/include/postgres/access/rmgrlist.h +49 -0
  32. data/ext/pg_query/include/postgres/access/sdir.h +67 -0
  33. data/ext/pg_query/include/postgres/access/skey.h +151 -0
  34. data/ext/pg_query/include/postgres/access/slru.h +221 -0
  35. data/ext/pg_query/include/postgres/access/stratnum.h +85 -0
  36. data/ext/pg_query/include/postgres/access/sysattr.h +29 -0
  37. data/ext/pg_query/include/postgres/access/table.h +28 -0
  38. data/ext/pg_query/include/postgres/access/tableam.h +2109 -0
  39. data/ext/pg_query/include/postgres/access/tidstore.h +50 -0
  40. data/ext/pg_query/include/postgres/access/toast_compression.h +73 -0
  41. data/ext/pg_query/include/postgres/access/transam.h +375 -0
  42. data/ext/pg_query/include/postgres/access/tsmapi.h +82 -0
  43. data/ext/pg_query/include/postgres/access/tupconvert.h +54 -0
  44. data/ext/pg_query/include/postgres/access/tupdesc.h +154 -0
  45. data/ext/pg_query/include/postgres/access/tupmacs.h +207 -0
  46. data/ext/pg_query/include/postgres/access/twophase.h +65 -0
  47. data/ext/pg_query/include/postgres/access/xact.h +530 -0
  48. data/ext/pg_query/include/postgres/access/xlog.h +310 -0
  49. data/ext/pg_query/include/postgres/access/xlog_internal.h +405 -0
  50. data/ext/pg_query/include/postgres/access/xlogbackup.h +43 -0
  51. data/ext/pg_query/include/postgres/access/xlogdefs.h +82 -0
  52. data/ext/pg_query/include/postgres/access/xlogprefetcher.h +55 -0
  53. data/ext/pg_query/include/postgres/access/xlogreader.h +444 -0
  54. data/ext/pg_query/include/postgres/access/xlogrecord.h +248 -0
  55. data/ext/pg_query/include/postgres/access/xlogrecovery.h +158 -0
  56. data/ext/pg_query/include/postgres/archive/archive_module.h +67 -0
  57. data/ext/pg_query/include/postgres/c.h +1374 -0
  58. data/ext/pg_query/include/postgres/catalog/catalog.h +47 -0
  59. data/ext/pg_query/include/postgres/catalog/catversion.h +62 -0
  60. data/ext/pg_query/include/postgres/catalog/dependency.h +228 -0
  61. data/ext/pg_query/include/postgres/catalog/genbki.h +149 -0
  62. data/ext/pg_query/include/postgres/catalog/index.h +218 -0
  63. data/ext/pg_query/include/postgres/catalog/indexing.h +54 -0
  64. data/ext/pg_query/include/postgres/catalog/namespace.h +189 -0
  65. data/ext/pg_query/include/postgres/catalog/objectaccess.h +267 -0
  66. data/ext/pg_query/include/postgres/catalog/objectaddress.h +89 -0
  67. data/ext/pg_query/include/postgres/catalog/pg_aggregate.h +182 -0
  68. data/ext/pg_query/include/postgres/catalog/pg_aggregate_d.h +78 -0
  69. data/ext/pg_query/include/postgres/catalog/pg_am.h +66 -0
  70. data/ext/pg_query/include/postgres/catalog/pg_am_d.h +47 -0
  71. data/ext/pg_query/include/postgres/catalog/pg_attribute.h +240 -0
  72. data/ext/pg_query/include/postgres/catalog/pg_attribute_d.h +62 -0
  73. data/ext/pg_query/include/postgres/catalog/pg_authid.h +66 -0
  74. data/ext/pg_query/include/postgres/catalog/pg_authid_d.h +60 -0
  75. data/ext/pg_query/include/postgres/catalog/pg_class.h +235 -0
  76. data/ext/pg_query/include/postgres/catalog/pg_class_d.h +134 -0
  77. data/ext/pg_query/include/postgres/catalog/pg_collation.h +106 -0
  78. data/ext/pg_query/include/postgres/catalog/pg_collation_d.h +66 -0
  79. data/ext/pg_query/include/postgres/catalog/pg_constraint.h +278 -0
  80. data/ext/pg_query/include/postgres/catalog/pg_constraint_d.h +74 -0
  81. data/ext/pg_query/include/postgres/catalog/pg_control.h +260 -0
  82. data/ext/pg_query/include/postgres/catalog/pg_conversion.h +79 -0
  83. data/ext/pg_query/include/postgres/catalog/pg_conversion_d.h +38 -0
  84. data/ext/pg_query/include/postgres/catalog/pg_database.h +129 -0
  85. data/ext/pg_query/include/postgres/catalog/pg_database_d.h +53 -0
  86. data/ext/pg_query/include/postgres/catalog/pg_depend.h +77 -0
  87. data/ext/pg_query/include/postgres/catalog/pg_depend_d.h +36 -0
  88. data/ext/pg_query/include/postgres/catalog/pg_event_trigger.h +60 -0
  89. data/ext/pg_query/include/postgres/catalog/pg_event_trigger_d.h +36 -0
  90. data/ext/pg_query/include/postgres/catalog/pg_index.h +92 -0
  91. data/ext/pg_query/include/postgres/catalog/pg_index_d.h +59 -0
  92. data/ext/pg_query/include/postgres/catalog/pg_language.h +75 -0
  93. data/ext/pg_query/include/postgres/catalog/pg_language_d.h +41 -0
  94. data/ext/pg_query/include/postgres/catalog/pg_namespace.h +67 -0
  95. data/ext/pg_query/include/postgres/catalog/pg_namespace_d.h +36 -0
  96. data/ext/pg_query/include/postgres/catalog/pg_opclass.h +91 -0
  97. data/ext/pg_query/include/postgres/catalog/pg_opclass_d.h +51 -0
  98. data/ext/pg_query/include/postgres/catalog/pg_operator.h +124 -0
  99. data/ext/pg_query/include/postgres/catalog/pg_operator_d.h +142 -0
  100. data/ext/pg_query/include/postgres/catalog/pg_opfamily.h +67 -0
  101. data/ext/pg_query/include/postgres/catalog/pg_opfamily_d.h +51 -0
  102. data/ext/pg_query/include/postgres/catalog/pg_partitioned_table.h +76 -0
  103. data/ext/pg_query/include/postgres/catalog/pg_partitioned_table_d.h +36 -0
  104. data/ext/pg_query/include/postgres/catalog/pg_proc.h +223 -0
  105. data/ext/pg_query/include/postgres/catalog/pg_proc_d.h +101 -0
  106. data/ext/pg_query/include/postgres/catalog/pg_publication.h +161 -0
  107. data/ext/pg_query/include/postgres/catalog/pg_publication_d.h +38 -0
  108. data/ext/pg_query/include/postgres/catalog/pg_replication_origin.h +65 -0
  109. data/ext/pg_query/include/postgres/catalog/pg_replication_origin_d.h +33 -0
  110. data/ext/pg_query/include/postgres/catalog/pg_statistic.h +288 -0
  111. data/ext/pg_query/include/postgres/catalog/pg_statistic_d.h +199 -0
  112. data/ext/pg_query/include/postgres/catalog/pg_statistic_ext.h +91 -0
  113. data/ext/pg_query/include/postgres/catalog/pg_statistic_ext_d.h +45 -0
  114. data/ext/pg_query/include/postgres/catalog/pg_transform.h +51 -0
  115. data/ext/pg_query/include/postgres/catalog/pg_transform_d.h +34 -0
  116. data/ext/pg_query/include/postgres/catalog/pg_trigger.h +153 -0
  117. data/ext/pg_query/include/postgres/catalog/pg_trigger_d.h +109 -0
  118. data/ext/pg_query/include/postgres/catalog/pg_ts_config.h +56 -0
  119. data/ext/pg_query/include/postgres/catalog/pg_ts_config_d.h +34 -0
  120. data/ext/pg_query/include/postgres/catalog/pg_ts_dict.h +62 -0
  121. data/ext/pg_query/include/postgres/catalog/pg_ts_dict_d.h +35 -0
  122. data/ext/pg_query/include/postgres/catalog/pg_ts_parser.h +63 -0
  123. data/ext/pg_query/include/postgres/catalog/pg_ts_parser_d.h +37 -0
  124. data/ext/pg_query/include/postgres/catalog/pg_ts_template.h +54 -0
  125. data/ext/pg_query/include/postgres/catalog/pg_ts_template_d.h +34 -0
  126. data/ext/pg_query/include/postgres/catalog/pg_type.h +407 -0
  127. data/ext/pg_query/include/postgres/catalog/pg_type_d.h +324 -0
  128. data/ext/pg_query/include/postgres/catalog/storage.h +50 -0
  129. data/ext/pg_query/include/postgres/catalog/syscache_ids.h +104 -0
  130. data/ext/pg_query/include/postgres/commands/async.h +49 -0
  131. data/ext/pg_query/include/postgres/commands/dbcommands.h +37 -0
  132. data/ext/pg_query/include/postgres/commands/defrem.h +161 -0
  133. data/ext/pg_query/include/postgres/commands/event_trigger.h +91 -0
  134. data/ext/pg_query/include/postgres/commands/explain.h +145 -0
  135. data/ext/pg_query/include/postgres/commands/prepare.h +61 -0
  136. data/ext/pg_query/include/postgres/commands/tablespace.h +69 -0
  137. data/ext/pg_query/include/postgres/commands/trigger.h +288 -0
  138. data/ext/pg_query/include/postgres/commands/vacuum.h +388 -0
  139. data/ext/pg_query/include/postgres/common/cryptohash.h +39 -0
  140. data/ext/pg_query/include/postgres/common/file_perm.h +56 -0
  141. data/ext/pg_query/include/postgres/common/file_utils.h +65 -0
  142. data/ext/pg_query/include/postgres/common/hashfn.h +119 -0
  143. data/ext/pg_query/include/postgres/common/hashfn_unstable.h +453 -0
  144. data/ext/pg_query/include/postgres/common/int.h +512 -0
  145. data/ext/pg_query/include/postgres/common/keywords.h +29 -0
  146. data/ext/pg_query/include/postgres/common/kwlookup.h +44 -0
  147. data/ext/pg_query/include/postgres/common/pg_prng.h +62 -0
  148. data/ext/pg_query/include/postgres/common/relpath.h +97 -0
  149. data/ext/pg_query/include/postgres/common/scram-common.h +70 -0
  150. data/ext/pg_query/include/postgres/common/sha2.h +32 -0
  151. data/ext/pg_query/include/postgres/common/string.h +44 -0
  152. data/ext/pg_query/include/postgres/common/unicode_east_asian_fw_table.h +124 -0
  153. data/ext/pg_query/include/postgres/copyfuncs.funcs.c +5261 -0
  154. data/ext/pg_query/include/postgres/copyfuncs.switch.c +989 -0
  155. data/ext/pg_query/include/postgres/datatype/timestamp.h +269 -0
  156. data/ext/pg_query/include/postgres/equalfuncs.funcs.c +3310 -0
  157. data/ext/pg_query/include/postgres/equalfuncs.switch.c +836 -0
  158. data/ext/pg_query/include/postgres/executor/execdesc.h +70 -0
  159. data/ext/pg_query/include/postgres/executor/executor.h +681 -0
  160. data/ext/pg_query/include/postgres/executor/functions.h +56 -0
  161. data/ext/pg_query/include/postgres/executor/instrument.h +120 -0
  162. data/ext/pg_query/include/postgres/executor/spi.h +207 -0
  163. data/ext/pg_query/include/postgres/executor/tablefunc.h +67 -0
  164. data/ext/pg_query/include/postgres/executor/tuptable.h +523 -0
  165. data/ext/pg_query/include/postgres/fmgr.h +800 -0
  166. data/ext/pg_query/include/postgres/foreign/fdwapi.h +294 -0
  167. data/ext/pg_query/include/postgres/funcapi.h +360 -0
  168. data/ext/pg_query/include/postgres/gram.h +1168 -0
  169. data/ext/pg_query/include/postgres/gramparse.h +75 -0
  170. data/ext/pg_query/include/postgres/jit/jit.h +106 -0
  171. data/ext/pg_query/include/postgres/kwlist_d.h +1164 -0
  172. data/ext/pg_query/include/postgres/lib/dshash.h +130 -0
  173. data/ext/pg_query/include/postgres/lib/ilist.h +1159 -0
  174. data/ext/pg_query/include/postgres/lib/pairingheap.h +102 -0
  175. data/ext/pg_query/include/postgres/lib/simplehash.h +1206 -0
  176. data/ext/pg_query/include/postgres/lib/sort_template.h +445 -0
  177. data/ext/pg_query/include/postgres/lib/stringinfo.h +243 -0
  178. data/ext/pg_query/include/postgres/libpq/auth.h +37 -0
  179. data/ext/pg_query/include/postgres/libpq/crypt.h +47 -0
  180. data/ext/pg_query/include/postgres/libpq/hba.h +186 -0
  181. data/ext/pg_query/include/postgres/libpq/libpq-be.h +358 -0
  182. data/ext/pg_query/include/postgres/libpq/libpq.h +143 -0
  183. data/ext/pg_query/include/postgres/libpq/pqcomm.h +169 -0
  184. data/ext/pg_query/include/postgres/libpq/pqformat.h +209 -0
  185. data/ext/pg_query/include/postgres/libpq/pqsignal.h +54 -0
  186. data/ext/pg_query/include/postgres/libpq/protocol.h +89 -0
  187. data/ext/pg_query/include/postgres/libpq/sasl.h +136 -0
  188. data/ext/pg_query/include/postgres/libpq/scram.h +37 -0
  189. data/ext/pg_query/include/postgres/mb/pg_wchar.h +792 -0
  190. data/ext/pg_query/include/postgres/mb/stringinfo_mb.h +24 -0
  191. data/ext/pg_query/include/postgres/miscadmin.h +519 -0
  192. data/ext/pg_query/include/postgres/nodes/bitmapset.h +140 -0
  193. data/ext/pg_query/include/postgres/nodes/execnodes.h +2852 -0
  194. data/ext/pg_query/include/postgres/nodes/extensible.h +164 -0
  195. data/ext/pg_query/include/postgres/nodes/lockoptions.h +61 -0
  196. data/ext/pg_query/include/postgres/nodes/makefuncs.h +127 -0
  197. data/ext/pg_query/include/postgres/nodes/memnodes.h +152 -0
  198. data/ext/pg_query/include/postgres/nodes/miscnodes.h +56 -0
  199. data/ext/pg_query/include/postgres/nodes/nodeFuncs.h +222 -0
  200. data/ext/pg_query/include/postgres/nodes/nodes.h +435 -0
  201. data/ext/pg_query/include/postgres/nodes/nodetags.h +491 -0
  202. data/ext/pg_query/include/postgres/nodes/params.h +170 -0
  203. data/ext/pg_query/include/postgres/nodes/parsenodes.h +4233 -0
  204. data/ext/pg_query/include/postgres/nodes/pathnodes.h +3435 -0
  205. data/ext/pg_query/include/postgres/nodes/pg_list.h +686 -0
  206. data/ext/pg_query/include/postgres/nodes/plannodes.h +1593 -0
  207. data/ext/pg_query/include/postgres/nodes/primnodes.h +2335 -0
  208. data/ext/pg_query/include/postgres/nodes/print.h +34 -0
  209. data/ext/pg_query/include/postgres/nodes/queryjumble.h +86 -0
  210. data/ext/pg_query/include/postgres/nodes/replnodes.h +132 -0
  211. data/ext/pg_query/include/postgres/nodes/supportnodes.h +346 -0
  212. data/ext/pg_query/include/postgres/nodes/tidbitmap.h +75 -0
  213. data/ext/pg_query/include/postgres/nodes/value.h +90 -0
  214. data/ext/pg_query/include/postgres/optimizer/cost.h +216 -0
  215. data/ext/pg_query/include/postgres/optimizer/geqo.h +90 -0
  216. data/ext/pg_query/include/postgres/optimizer/geqo_gene.h +45 -0
  217. data/ext/pg_query/include/postgres/optimizer/optimizer.h +205 -0
  218. data/ext/pg_query/include/postgres/optimizer/paths.h +271 -0
  219. data/ext/pg_query/include/postgres/optimizer/planmain.h +123 -0
  220. data/ext/pg_query/include/postgres/parser/analyze.h +66 -0
  221. data/ext/pg_query/include/postgres/parser/kwlist.h +518 -0
  222. data/ext/pg_query/include/postgres/parser/parse_agg.h +65 -0
  223. data/ext/pg_query/include/postgres/parser/parse_coerce.h +102 -0
  224. data/ext/pg_query/include/postgres/parser/parse_expr.h +25 -0
  225. data/ext/pg_query/include/postgres/parser/parse_func.h +74 -0
  226. data/ext/pg_query/include/postgres/parser/parse_node.h +358 -0
  227. data/ext/pg_query/include/postgres/parser/parse_oper.h +68 -0
  228. data/ext/pg_query/include/postgres/parser/parse_relation.h +129 -0
  229. data/ext/pg_query/include/postgres/parser/parse_type.h +61 -0
  230. data/ext/pg_query/include/postgres/parser/parser.h +68 -0
  231. data/ext/pg_query/include/postgres/parser/parsetree.h +61 -0
  232. data/ext/pg_query/include/postgres/parser/scanner.h +152 -0
  233. data/ext/pg_query/include/postgres/parser/scansup.h +27 -0
  234. data/ext/pg_query/include/postgres/partitioning/partdefs.h +26 -0
  235. data/ext/pg_query/include/postgres/pg_config.h +977 -0
  236. data/ext/pg_query/include/postgres/pg_config_manual.h +385 -0
  237. data/ext/pg_query/include/postgres/pg_config_os.h +8 -0
  238. data/ext/pg_query/include/postgres/pg_getopt.h +56 -0
  239. data/ext/pg_query/include/postgres/pg_trace.h +17 -0
  240. data/ext/pg_query/include/postgres/pgstat.h +780 -0
  241. data/ext/pg_query/include/postgres/pgtime.h +94 -0
  242. data/ext/pg_query/include/postgres/pl_gram.h +385 -0
  243. data/ext/pg_query/include/postgres/pl_reserved_kwlist.h +52 -0
  244. data/ext/pg_query/include/postgres/pl_reserved_kwlist_d.h +114 -0
  245. data/ext/pg_query/include/postgres/pl_unreserved_kwlist.h +112 -0
  246. data/ext/pg_query/include/postgres/pl_unreserved_kwlist_d.h +246 -0
  247. data/ext/pg_query/include/postgres/plerrcodes.h +998 -0
  248. data/ext/pg_query/include/postgres/plpgsql.h +1342 -0
  249. data/ext/pg_query/include/postgres/port/atomics/arch-arm.h +32 -0
  250. data/ext/pg_query/include/postgres/port/atomics/arch-hppa.h +17 -0
  251. data/ext/pg_query/include/postgres/port/atomics/arch-ppc.h +256 -0
  252. data/ext/pg_query/include/postgres/port/atomics/arch-x86.h +254 -0
  253. data/ext/pg_query/include/postgres/port/atomics/fallback.h +170 -0
  254. data/ext/pg_query/include/postgres/port/atomics/generic-gcc.h +323 -0
  255. data/ext/pg_query/include/postgres/port/atomics/generic-msvc.h +119 -0
  256. data/ext/pg_query/include/postgres/port/atomics/generic-sunpro.h +121 -0
  257. data/ext/pg_query/include/postgres/port/atomics/generic.h +437 -0
  258. data/ext/pg_query/include/postgres/port/atomics.h +606 -0
  259. data/ext/pg_query/include/postgres/port/pg_bitutils.h +421 -0
  260. data/ext/pg_query/include/postgres/port/pg_bswap.h +161 -0
  261. data/ext/pg_query/include/postgres/port/pg_crc32c.h +110 -0
  262. data/ext/pg_query/include/postgres/port/pg_iovec.h +117 -0
  263. data/ext/pg_query/include/postgres/port/simd.h +422 -0
  264. data/ext/pg_query/include/postgres/port/win32/arpa/inet.h +3 -0
  265. data/ext/pg_query/include/postgres/port/win32/dlfcn.h +1 -0
  266. data/ext/pg_query/include/postgres/port/win32/grp.h +1 -0
  267. data/ext/pg_query/include/postgres/port/win32/netdb.h +7 -0
  268. data/ext/pg_query/include/postgres/port/win32/netinet/in.h +3 -0
  269. data/ext/pg_query/include/postgres/port/win32/netinet/tcp.h +7 -0
  270. data/ext/pg_query/include/postgres/port/win32/pwd.h +3 -0
  271. data/ext/pg_query/include/postgres/port/win32/sys/resource.h +20 -0
  272. data/ext/pg_query/include/postgres/port/win32/sys/select.h +3 -0
  273. data/ext/pg_query/include/postgres/port/win32/sys/socket.h +34 -0
  274. data/ext/pg_query/include/postgres/port/win32/sys/un.h +17 -0
  275. data/ext/pg_query/include/postgres/port/win32/sys/wait.h +3 -0
  276. data/ext/pg_query/include/postgres/port/win32.h +59 -0
  277. data/ext/pg_query/include/postgres/port/win32_msvc/dirent.h +34 -0
  278. data/ext/pg_query/include/postgres/port/win32_msvc/sys/file.h +1 -0
  279. data/ext/pg_query/include/postgres/port/win32_msvc/sys/param.h +1 -0
  280. data/ext/pg_query/include/postgres/port/win32_msvc/sys/time.h +1 -0
  281. data/ext/pg_query/include/postgres/port/win32_msvc/unistd.h +9 -0
  282. data/ext/pg_query/include/postgres/port/win32_msvc/utime.h +3 -0
  283. data/ext/pg_query/include/postgres/port/win32_port.h +584 -0
  284. data/ext/pg_query/include/postgres/port.h +524 -0
  285. data/ext/pg_query/include/postgres/portability/instr_time.h +197 -0
  286. data/ext/pg_query/include/postgres/postgres.h +579 -0
  287. data/ext/pg_query/include/postgres/postmaster/autovacuum.h +69 -0
  288. data/ext/pg_query/include/postgres/postmaster/bgworker.h +164 -0
  289. data/ext/pg_query/include/postgres/postmaster/bgworker_internals.h +60 -0
  290. data/ext/pg_query/include/postgres/postmaster/bgwriter.h +45 -0
  291. data/ext/pg_query/include/postgres/postmaster/interrupt.h +32 -0
  292. data/ext/pg_query/include/postgres/postmaster/pgarch.h +36 -0
  293. data/ext/pg_query/include/postgres/postmaster/postmaster.h +101 -0
  294. data/ext/pg_query/include/postgres/postmaster/startup.h +41 -0
  295. data/ext/pg_query/include/postgres/postmaster/syslogger.h +101 -0
  296. data/ext/pg_query/include/postgres/postmaster/walsummarizer.h +35 -0
  297. data/ext/pg_query/include/postgres/postmaster/walwriter.h +23 -0
  298. data/ext/pg_query/include/postgres/regex/regex.h +272 -0
  299. data/ext/pg_query/include/postgres/replication/logicallauncher.h +34 -0
  300. data/ext/pg_query/include/postgres/replication/logicalproto.h +274 -0
  301. data/ext/pg_query/include/postgres/replication/logicalworker.h +33 -0
  302. data/ext/pg_query/include/postgres/replication/origin.h +73 -0
  303. data/ext/pg_query/include/postgres/replication/reorderbuffer.h +743 -0
  304. data/ext/pg_query/include/postgres/replication/slot.h +285 -0
  305. data/ext/pg_query/include/postgres/replication/slotsync.h +38 -0
  306. data/ext/pg_query/include/postgres/replication/syncrep.h +109 -0
  307. data/ext/pg_query/include/postgres/replication/walreceiver.h +504 -0
  308. data/ext/pg_query/include/postgres/replication/walsender.h +76 -0
  309. data/ext/pg_query/include/postgres/rewrite/prs2lock.h +46 -0
  310. data/ext/pg_query/include/postgres/rewrite/rewriteHandler.h +41 -0
  311. data/ext/pg_query/include/postgres/rewrite/rewriteManip.h +96 -0
  312. data/ext/pg_query/include/postgres/rewrite/rewriteSupport.h +26 -0
  313. data/ext/pg_query/include/postgres/storage/block.h +108 -0
  314. data/ext/pg_query/include/postgres/storage/buf.h +46 -0
  315. data/ext/pg_query/include/postgres/storage/bufmgr.h +411 -0
  316. data/ext/pg_query/include/postgres/storage/bufpage.h +510 -0
  317. data/ext/pg_query/include/postgres/storage/condition_variable.h +73 -0
  318. data/ext/pg_query/include/postgres/storage/dsm.h +61 -0
  319. data/ext/pg_query/include/postgres/storage/dsm_impl.h +79 -0
  320. data/ext/pg_query/include/postgres/storage/fd.h +219 -0
  321. data/ext/pg_query/include/postgres/storage/fileset.h +40 -0
  322. data/ext/pg_query/include/postgres/storage/ipc.h +87 -0
  323. data/ext/pg_query/include/postgres/storage/item.h +19 -0
  324. data/ext/pg_query/include/postgres/storage/itemid.h +184 -0
  325. data/ext/pg_query/include/postgres/storage/itemptr.h +245 -0
  326. data/ext/pg_query/include/postgres/storage/large_object.h +100 -0
  327. data/ext/pg_query/include/postgres/storage/latch.h +196 -0
  328. data/ext/pg_query/include/postgres/storage/lmgr.h +126 -0
  329. data/ext/pg_query/include/postgres/storage/lock.h +624 -0
  330. data/ext/pg_query/include/postgres/storage/lockdefs.h +59 -0
  331. data/ext/pg_query/include/postgres/storage/lwlock.h +228 -0
  332. data/ext/pg_query/include/postgres/storage/lwlocknames.h +47 -0
  333. data/ext/pg_query/include/postgres/storage/off.h +57 -0
  334. data/ext/pg_query/include/postgres/storage/pg_sema.h +61 -0
  335. data/ext/pg_query/include/postgres/storage/pg_shmem.h +93 -0
  336. data/ext/pg_query/include/postgres/storage/pmsignal.h +105 -0
  337. data/ext/pg_query/include/postgres/storage/predicate.h +83 -0
  338. data/ext/pg_query/include/postgres/storage/proc.h +491 -0
  339. data/ext/pg_query/include/postgres/storage/procarray.h +103 -0
  340. data/ext/pg_query/include/postgres/storage/proclist_types.h +53 -0
  341. data/ext/pg_query/include/postgres/storage/procnumber.h +43 -0
  342. data/ext/pg_query/include/postgres/storage/procsignal.h +75 -0
  343. data/ext/pg_query/include/postgres/storage/read_stream.h +65 -0
  344. data/ext/pg_query/include/postgres/storage/relfilelocator.h +100 -0
  345. data/ext/pg_query/include/postgres/storage/s_lock.h +847 -0
  346. data/ext/pg_query/include/postgres/storage/sharedfileset.h +37 -0
  347. data/ext/pg_query/include/postgres/storage/shm_mq.h +86 -0
  348. data/ext/pg_query/include/postgres/storage/shm_toc.h +58 -0
  349. data/ext/pg_query/include/postgres/storage/shmem.h +59 -0
  350. data/ext/pg_query/include/postgres/storage/sinval.h +153 -0
  351. data/ext/pg_query/include/postgres/storage/smgr.h +127 -0
  352. data/ext/pg_query/include/postgres/storage/spin.h +77 -0
  353. data/ext/pg_query/include/postgres/storage/standby.h +109 -0
  354. data/ext/pg_query/include/postgres/storage/standbydefs.h +74 -0
  355. data/ext/pg_query/include/postgres/storage/sync.h +66 -0
  356. data/ext/pg_query/include/postgres/tcop/cmdtag.h +62 -0
  357. data/ext/pg_query/include/postgres/tcop/cmdtaglist.h +219 -0
  358. data/ext/pg_query/include/postgres/tcop/deparse_utility.h +108 -0
  359. data/ext/pg_query/include/postgres/tcop/dest.h +148 -0
  360. data/ext/pg_query/include/postgres/tcop/fastpath.h +20 -0
  361. data/ext/pg_query/include/postgres/tcop/pquery.h +51 -0
  362. data/ext/pg_query/include/postgres/tcop/tcopprot.h +98 -0
  363. data/ext/pg_query/include/postgres/tcop/utility.h +112 -0
  364. data/ext/pg_query/include/postgres/tsearch/ts_cache.h +96 -0
  365. data/ext/pg_query/include/postgres/utils/acl.h +290 -0
  366. data/ext/pg_query/include/postgres/utils/aclchk_internal.h +45 -0
  367. data/ext/pg_query/include/postgres/utils/array.h +481 -0
  368. data/ext/pg_query/include/postgres/utils/ascii.h +84 -0
  369. data/ext/pg_query/include/postgres/utils/backend_progress.h +46 -0
  370. data/ext/pg_query/include/postgres/utils/backend_status.h +340 -0
  371. data/ext/pg_query/include/postgres/utils/builtins.h +139 -0
  372. data/ext/pg_query/include/postgres/utils/bytea.h +28 -0
  373. data/ext/pg_query/include/postgres/utils/catcache.h +230 -0
  374. data/ext/pg_query/include/postgres/utils/date.h +118 -0
  375. data/ext/pg_query/include/postgres/utils/datetime.h +367 -0
  376. data/ext/pg_query/include/postgres/utils/datum.h +76 -0
  377. data/ext/pg_query/include/postgres/utils/dsa.h +166 -0
  378. data/ext/pg_query/include/postgres/utils/elog.h +540 -0
  379. data/ext/pg_query/include/postgres/utils/errcodes.h +352 -0
  380. data/ext/pg_query/include/postgres/utils/expandeddatum.h +170 -0
  381. data/ext/pg_query/include/postgres/utils/expandedrecord.h +241 -0
  382. data/ext/pg_query/include/postgres/utils/float.h +357 -0
  383. data/ext/pg_query/include/postgres/utils/fmgroids.h +3347 -0
  384. data/ext/pg_query/include/postgres/utils/fmgrprotos.h +2904 -0
  385. data/ext/pg_query/include/postgres/utils/fmgrtab.h +49 -0
  386. data/ext/pg_query/include/postgres/utils/guc.h +456 -0
  387. data/ext/pg_query/include/postgres/utils/guc_hooks.h +184 -0
  388. data/ext/pg_query/include/postgres/utils/guc_tables.h +323 -0
  389. data/ext/pg_query/include/postgres/utils/hsearch.h +153 -0
  390. data/ext/pg_query/include/postgres/utils/injection_point.h +44 -0
  391. data/ext/pg_query/include/postgres/utils/inval.h +68 -0
  392. data/ext/pg_query/include/postgres/utils/logtape.h +77 -0
  393. data/ext/pg_query/include/postgres/utils/lsyscache.h +215 -0
  394. data/ext/pg_query/include/postgres/utils/memdebug.h +82 -0
  395. data/ext/pg_query/include/postgres/utils/memutils.h +193 -0
  396. data/ext/pg_query/include/postgres/utils/memutils_internal.h +176 -0
  397. data/ext/pg_query/include/postgres/utils/memutils_memorychunk.h +253 -0
  398. data/ext/pg_query/include/postgres/utils/numeric.h +110 -0
  399. data/ext/pg_query/include/postgres/utils/palloc.h +151 -0
  400. data/ext/pg_query/include/postgres/utils/partcache.h +103 -0
  401. data/ext/pg_query/include/postgres/utils/pg_locale.h +136 -0
  402. data/ext/pg_query/include/postgres/utils/pgstat_internal.h +808 -0
  403. data/ext/pg_query/include/postgres/utils/plancache.h +238 -0
  404. data/ext/pg_query/include/postgres/utils/portal.h +252 -0
  405. data/ext/pg_query/include/postgres/utils/queryenvironment.h +74 -0
  406. data/ext/pg_query/include/postgres/utils/regproc.h +39 -0
  407. data/ext/pg_query/include/postgres/utils/rel.h +711 -0
  408. data/ext/pg_query/include/postgres/utils/relcache.h +155 -0
  409. data/ext/pg_query/include/postgres/utils/reltrigger.h +81 -0
  410. data/ext/pg_query/include/postgres/utils/resowner.h +167 -0
  411. data/ext/pg_query/include/postgres/utils/ruleutils.h +52 -0
  412. data/ext/pg_query/include/postgres/utils/sharedtuplestore.h +61 -0
  413. data/ext/pg_query/include/postgres/utils/snapmgr.h +130 -0
  414. data/ext/pg_query/include/postgres/utils/snapshot.h +219 -0
  415. data/ext/pg_query/include/postgres/utils/sortsupport.h +391 -0
  416. data/ext/pg_query/include/postgres/utils/syscache.h +131 -0
  417. data/ext/pg_query/include/postgres/utils/timeout.h +96 -0
  418. data/ext/pg_query/include/postgres/utils/timestamp.h +147 -0
  419. data/ext/pg_query/include/postgres/utils/tuplesort.h +472 -0
  420. data/ext/pg_query/include/postgres/utils/tuplestore.h +88 -0
  421. data/ext/pg_query/include/postgres/utils/typcache.h +210 -0
  422. data/ext/pg_query/include/postgres/utils/varlena.h +53 -0
  423. data/ext/pg_query/include/postgres/utils/wait_event.h +108 -0
  424. data/ext/pg_query/include/postgres/utils/wait_event_types.h +218 -0
  425. data/ext/pg_query/include/postgres/utils/xml.h +94 -0
  426. data/ext/pg_query/include/postgres/varatt.h +358 -0
  427. data/ext/pg_query/include/protobuf/pg_query.pb-c.h +1546 -792
  428. data/ext/pg_query/include/protobuf/pg_query.pb.h +58365 -46595
  429. data/ext/pg_query/pg_query.c +9 -0
  430. data/ext/pg_query/pg_query.pb-c.c +6598 -3739
  431. data/ext/pg_query/pg_query_fingerprint.c +4 -5
  432. data/ext/pg_query/pg_query_normalize.c +42 -1
  433. data/ext/pg_query/pg_query_outfuncs_json.c +9 -1
  434. data/ext/pg_query/pg_query_outfuncs_protobuf.c +1 -0
  435. data/ext/pg_query/pg_query_parse.c +1 -1
  436. data/ext/pg_query/pg_query_parse_plpgsql.c +18 -17
  437. data/ext/pg_query/pg_query_readfuncs_protobuf.c +3 -2
  438. data/ext/pg_query/pg_query_ruby.c +5 -0
  439. data/ext/pg_query/pg_query_ruby_freebsd.sym +0 -1
  440. data/ext/pg_query/pg_query_scan.c +1 -1
  441. data/ext/pg_query/pg_query_split.c +1 -1
  442. data/ext/pg_query/postgres_deparse.c +409 -21
  443. data/ext/pg_query/src_backend_catalog_namespace.c +241 -66
  444. data/ext/pg_query/src_backend_catalog_pg_proc.c +1 -3
  445. data/ext/pg_query/src_backend_commands_define.c +2 -3
  446. data/ext/pg_query/src_backend_nodes_bitmapset.c +137 -94
  447. data/ext/pg_query/src_backend_nodes_copyfuncs.c +1 -1
  448. data/ext/pg_query/src_backend_nodes_equalfuncs.c +1 -1
  449. data/ext/pg_query/src_backend_nodes_extensible.c +1 -1
  450. data/ext/pg_query/src_backend_nodes_list.c +3 -7
  451. data/ext/pg_query/src_backend_nodes_makefuncs.c +59 -20
  452. data/ext/pg_query/src_backend_nodes_nodeFuncs.c +109 -2
  453. data/ext/pg_query/src_backend_nodes_value.c +1 -1
  454. data/ext/pg_query/src_backend_parser_gram.c +34490 -32135
  455. data/ext/pg_query/src_backend_parser_parser.c +8 -8
  456. data/ext/pg_query/src_backend_parser_scan.c +5637 -3028
  457. data/ext/pg_query/src_backend_parser_scansup.c +2 -1
  458. data/ext/pg_query/src_backend_storage_ipc_ipc.c +1 -1
  459. data/ext/pg_query/src_backend_tcop_postgres.c +34 -10
  460. data/ext/pg_query/src_backend_utils_activity_pgstat_database.c +2 -2
  461. data/ext/pg_query/src_backend_utils_adt_datum.c +8 -6
  462. data/ext/pg_query/src_backend_utils_adt_expandeddatum.c +1 -1
  463. data/ext/pg_query/src_backend_utils_adt_format_type.c +1 -1
  464. data/ext/pg_query/src_backend_utils_adt_numutils.c +4 -5
  465. data/ext/pg_query/src_backend_utils_adt_ruleutils.c +101 -28
  466. data/ext/pg_query/src_backend_utils_error_assert.c +1 -1
  467. data/ext/pg_query/src_backend_utils_error_elog.c +60 -190
  468. data/ext/pg_query/src_backend_utils_fmgr_fmgr.c +4 -2
  469. data/ext/pg_query/src_backend_utils_init_globals.c +16 -4
  470. data/ext/pg_query/src_backend_utils_mb_mbutils.c +19 -81
  471. data/ext/pg_query/src_backend_utils_misc_guc_tables.c +16 -8
  472. data/ext/pg_query/src_backend_utils_mmgr_alignedalloc.c +8 -5
  473. data/ext/pg_query/src_backend_utils_mmgr_aset.c +308 -238
  474. data/ext/pg_query/src_backend_utils_mmgr_bump.c +728 -0
  475. data/ext/pg_query/src_backend_utils_mmgr_generation.c +273 -197
  476. data/ext/pg_query/src_backend_utils_mmgr_mcxt.c +270 -215
  477. data/ext/pg_query/src_backend_utils_mmgr_slab.c +154 -96
  478. data/ext/pg_query/src_common_encnames.c +43 -44
  479. data/ext/pg_query/src_common_hashfn.c +1 -1
  480. data/ext/pg_query/src_common_keywords.c +1 -1
  481. data/ext/pg_query/src_common_kwlist_d.h +511 -466
  482. data/ext/pg_query/src_common_kwlookup.c +1 -1
  483. data/ext/pg_query/src_common_psprintf.c +3 -3
  484. data/ext/pg_query/src_common_stringinfo.c +18 -1
  485. data/ext/pg_query/src_common_wchar.c +45 -108
  486. data/ext/pg_query/src_pl_plpgsql_src_pl_comp.c +99 -5
  487. data/ext/pg_query/src_pl_plpgsql_src_pl_funcs.c +1 -1
  488. data/ext/pg_query/src_pl_plpgsql_src_pl_gram.c +242 -143
  489. data/ext/pg_query/src_pl_plpgsql_src_pl_handler.c +1 -1
  490. data/ext/pg_query/src_pl_plpgsql_src_pl_reserved_kwlist_d.h +1 -1
  491. data/ext/pg_query/src_pl_plpgsql_src_pl_scanner.c +19 -1
  492. data/ext/pg_query/src_pl_plpgsql_src_pl_unreserved_kwlist_d.h +1 -1
  493. data/ext/pg_query/src_port_pg_bitutils.c +251 -32
  494. data/ext/pg_query/src_port_pgstrcasecmp.c +29 -1
  495. data/ext/pg_query/src_port_snprintf.c +4 -4
  496. data/ext/pg_query/src_port_strerror.c +1 -3
  497. data/ext/pg_query/src_port_strlcpy.c +79 -0
  498. data/lib/pg_query/fingerprint.rb +2 -3
  499. data/lib/pg_query/node.rb +16 -11
  500. data/lib/pg_query/param_refs.rb +1 -1
  501. data/lib/pg_query/parse.rb +1 -1
  502. data/lib/pg_query/pg_query_pb.rb +26 -3
  503. data/lib/pg_query/treewalker.rb +52 -12
  504. data/lib/pg_query/truncate.rb +1 -1
  505. data/lib/pg_query/version.rb +1 -1
  506. metadata +444 -400
  507. data/ext/pg_query/guc-file.c +0 -0
  508. data/ext/pg_query/include/access/amapi.h +0 -292
  509. data/ext/pg_query/include/access/attmap.h +0 -54
  510. data/ext/pg_query/include/access/attnum.h +0 -64
  511. data/ext/pg_query/include/access/clog.h +0 -63
  512. data/ext/pg_query/include/access/commit_ts.h +0 -74
  513. data/ext/pg_query/include/access/detoast.h +0 -82
  514. data/ext/pg_query/include/access/genam.h +0 -233
  515. data/ext/pg_query/include/access/gin.h +0 -91
  516. data/ext/pg_query/include/access/htup.h +0 -89
  517. data/ext/pg_query/include/access/htup_details.h +0 -811
  518. data/ext/pg_query/include/access/itup.h +0 -170
  519. data/ext/pg_query/include/access/parallel.h +0 -82
  520. data/ext/pg_query/include/access/printtup.h +0 -35
  521. data/ext/pg_query/include/access/relation.h +0 -28
  522. data/ext/pg_query/include/access/relscan.h +0 -191
  523. data/ext/pg_query/include/access/rmgrlist.h +0 -49
  524. data/ext/pg_query/include/access/sdir.h +0 -67
  525. data/ext/pg_query/include/access/skey.h +0 -151
  526. data/ext/pg_query/include/access/stratnum.h +0 -85
  527. data/ext/pg_query/include/access/sysattr.h +0 -29
  528. data/ext/pg_query/include/access/table.h +0 -28
  529. data/ext/pg_query/include/access/tableam.h +0 -2100
  530. data/ext/pg_query/include/access/toast_compression.h +0 -73
  531. data/ext/pg_query/include/access/transam.h +0 -375
  532. data/ext/pg_query/include/access/tsmapi.h +0 -82
  533. data/ext/pg_query/include/access/tupconvert.h +0 -54
  534. data/ext/pg_query/include/access/tupdesc.h +0 -154
  535. data/ext/pg_query/include/access/tupmacs.h +0 -207
  536. data/ext/pg_query/include/access/twophase.h +0 -65
  537. data/ext/pg_query/include/access/xact.h +0 -530
  538. data/ext/pg_query/include/access/xlog.h +0 -302
  539. data/ext/pg_query/include/access/xlog_internal.h +0 -404
  540. data/ext/pg_query/include/access/xlogbackup.h +0 -41
  541. data/ext/pg_query/include/access/xlogdefs.h +0 -82
  542. data/ext/pg_query/include/access/xlogprefetcher.h +0 -55
  543. data/ext/pg_query/include/access/xlogreader.h +0 -444
  544. data/ext/pg_query/include/access/xlogrecord.h +0 -248
  545. data/ext/pg_query/include/access/xlogrecovery.h +0 -158
  546. data/ext/pg_query/include/archive/archive_module.h +0 -59
  547. data/ext/pg_query/include/c.h +0 -1379
  548. data/ext/pg_query/include/catalog/catalog.h +0 -45
  549. data/ext/pg_query/include/catalog/catversion.h +0 -62
  550. data/ext/pg_query/include/catalog/dependency.h +0 -270
  551. data/ext/pg_query/include/catalog/genbki.h +0 -143
  552. data/ext/pg_query/include/catalog/index.h +0 -214
  553. data/ext/pg_query/include/catalog/indexing.h +0 -54
  554. data/ext/pg_query/include/catalog/namespace.h +0 -190
  555. data/ext/pg_query/include/catalog/objectaccess.h +0 -267
  556. data/ext/pg_query/include/catalog/objectaddress.h +0 -89
  557. data/ext/pg_query/include/catalog/pg_aggregate.h +0 -180
  558. data/ext/pg_query/include/catalog/pg_aggregate_d.h +0 -78
  559. data/ext/pg_query/include/catalog/pg_am.h +0 -63
  560. data/ext/pg_query/include/catalog/pg_am_d.h +0 -47
  561. data/ext/pg_query/include/catalog/pg_attribute.h +0 -223
  562. data/ext/pg_query/include/catalog/pg_attribute_d.h +0 -62
  563. data/ext/pg_query/include/catalog/pg_authid.h +0 -63
  564. data/ext/pg_query/include/catalog/pg_authid_d.h +0 -59
  565. data/ext/pg_query/include/catalog/pg_class.h +0 -230
  566. data/ext/pg_query/include/catalog/pg_class_d.h +0 -132
  567. data/ext/pg_query/include/catalog/pg_collation.h +0 -100
  568. data/ext/pg_query/include/catalog/pg_collation_d.h +0 -63
  569. data/ext/pg_query/include/catalog/pg_constraint.h +0 -273
  570. data/ext/pg_query/include/catalog/pg_constraint_d.h +0 -73
  571. data/ext/pg_query/include/catalog/pg_control.h +0 -258
  572. data/ext/pg_query/include/catalog/pg_conversion.h +0 -75
  573. data/ext/pg_query/include/catalog/pg_conversion_d.h +0 -38
  574. data/ext/pg_query/include/catalog/pg_database.h +0 -124
  575. data/ext/pg_query/include/catalog/pg_database_d.h +0 -52
  576. data/ext/pg_query/include/catalog/pg_depend.h +0 -77
  577. data/ext/pg_query/include/catalog/pg_depend_d.h +0 -36
  578. data/ext/pg_query/include/catalog/pg_event_trigger.h +0 -57
  579. data/ext/pg_query/include/catalog/pg_event_trigger_d.h +0 -36
  580. data/ext/pg_query/include/catalog/pg_index.h +0 -90
  581. data/ext/pg_query/include/catalog/pg_index_d.h +0 -59
  582. data/ext/pg_query/include/catalog/pg_language.h +0 -72
  583. data/ext/pg_query/include/catalog/pg_language_d.h +0 -41
  584. data/ext/pg_query/include/catalog/pg_namespace.h +0 -64
  585. data/ext/pg_query/include/catalog/pg_namespace_d.h +0 -36
  586. data/ext/pg_query/include/catalog/pg_opclass.h +0 -88
  587. data/ext/pg_query/include/catalog/pg_opclass_d.h +0 -51
  588. data/ext/pg_query/include/catalog/pg_operator.h +0 -107
  589. data/ext/pg_query/include/catalog/pg_operator_d.h +0 -142
  590. data/ext/pg_query/include/catalog/pg_opfamily.h +0 -64
  591. data/ext/pg_query/include/catalog/pg_opfamily_d.h +0 -51
  592. data/ext/pg_query/include/catalog/pg_partitioned_table.h +0 -74
  593. data/ext/pg_query/include/catalog/pg_partitioned_table_d.h +0 -36
  594. data/ext/pg_query/include/catalog/pg_proc.h +0 -220
  595. data/ext/pg_query/include/catalog/pg_proc_d.h +0 -101
  596. data/ext/pg_query/include/catalog/pg_publication.h +0 -158
  597. data/ext/pg_query/include/catalog/pg_publication_d.h +0 -38
  598. data/ext/pg_query/include/catalog/pg_replication_origin.h +0 -62
  599. data/ext/pg_query/include/catalog/pg_replication_origin_d.h +0 -33
  600. data/ext/pg_query/include/catalog/pg_statistic.h +0 -282
  601. data/ext/pg_query/include/catalog/pg_statistic_d.h +0 -195
  602. data/ext/pg_query/include/catalog/pg_statistic_ext.h +0 -88
  603. data/ext/pg_query/include/catalog/pg_statistic_ext_d.h +0 -45
  604. data/ext/pg_query/include/catalog/pg_transform.h +0 -48
  605. data/ext/pg_query/include/catalog/pg_transform_d.h +0 -34
  606. data/ext/pg_query/include/catalog/pg_trigger.h +0 -153
  607. data/ext/pg_query/include/catalog/pg_trigger_d.h +0 -109
  608. data/ext/pg_query/include/catalog/pg_ts_config.h +0 -53
  609. data/ext/pg_query/include/catalog/pg_ts_config_d.h +0 -34
  610. data/ext/pg_query/include/catalog/pg_ts_dict.h +0 -59
  611. data/ext/pg_query/include/catalog/pg_ts_dict_d.h +0 -35
  612. data/ext/pg_query/include/catalog/pg_ts_parser.h +0 -60
  613. data/ext/pg_query/include/catalog/pg_ts_parser_d.h +0 -37
  614. data/ext/pg_query/include/catalog/pg_ts_template.h +0 -51
  615. data/ext/pg_query/include/catalog/pg_ts_template_d.h +0 -34
  616. data/ext/pg_query/include/catalog/pg_type.h +0 -404
  617. data/ext/pg_query/include/catalog/pg_type_d.h +0 -324
  618. data/ext/pg_query/include/catalog/storage.h +0 -50
  619. data/ext/pg_query/include/commands/async.h +0 -53
  620. data/ext/pg_query/include/commands/dbcommands.h +0 -37
  621. data/ext/pg_query/include/commands/defrem.h +0 -161
  622. data/ext/pg_query/include/commands/event_trigger.h +0 -88
  623. data/ext/pg_query/include/commands/explain.h +0 -129
  624. data/ext/pg_query/include/commands/prepare.h +0 -61
  625. data/ext/pg_query/include/commands/tablespace.h +0 -69
  626. data/ext/pg_query/include/commands/trigger.h +0 -288
  627. data/ext/pg_query/include/commands/vacuum.h +0 -386
  628. data/ext/pg_query/include/common/cryptohash.h +0 -39
  629. data/ext/pg_query/include/common/file_perm.h +0 -56
  630. data/ext/pg_query/include/common/hashfn.h +0 -104
  631. data/ext/pg_query/include/common/int.h +0 -437
  632. data/ext/pg_query/include/common/ip.h +0 -33
  633. data/ext/pg_query/include/common/keywords.h +0 -29
  634. data/ext/pg_query/include/common/kwlookup.h +0 -44
  635. data/ext/pg_query/include/common/pg_prng.h +0 -61
  636. data/ext/pg_query/include/common/relpath.h +0 -97
  637. data/ext/pg_query/include/common/scram-common.h +0 -70
  638. data/ext/pg_query/include/common/sha2.h +0 -32
  639. data/ext/pg_query/include/common/string.h +0 -44
  640. data/ext/pg_query/include/common/unicode_east_asian_fw_table.h +0 -125
  641. data/ext/pg_query/include/copyfuncs.funcs.c +0 -5013
  642. data/ext/pg_query/include/copyfuncs.switch.c +0 -938
  643. data/ext/pg_query/include/datatype/timestamp.h +0 -243
  644. data/ext/pg_query/include/equalfuncs.funcs.c +0 -3097
  645. data/ext/pg_query/include/equalfuncs.switch.c +0 -785
  646. data/ext/pg_query/include/executor/execdesc.h +0 -70
  647. data/ext/pg_query/include/executor/executor.h +0 -680
  648. data/ext/pg_query/include/executor/functions.h +0 -55
  649. data/ext/pg_query/include/executor/instrument.h +0 -118
  650. data/ext/pg_query/include/executor/spi.h +0 -213
  651. data/ext/pg_query/include/executor/tablefunc.h +0 -67
  652. data/ext/pg_query/include/executor/tuptable.h +0 -494
  653. data/ext/pg_query/include/fmgr.h +0 -800
  654. data/ext/pg_query/include/foreign/fdwapi.h +0 -294
  655. data/ext/pg_query/include/funcapi.h +0 -360
  656. data/ext/pg_query/include/gram.h +0 -1127
  657. data/ext/pg_query/include/gramparse.h +0 -75
  658. data/ext/pg_query/include/jit/jit.h +0 -105
  659. data/ext/pg_query/include/kwlist_d.h +0 -1119
  660. data/ext/pg_query/include/lib/dshash.h +0 -115
  661. data/ext/pg_query/include/lib/ilist.h +0 -1159
  662. data/ext/pg_query/include/lib/pairingheap.h +0 -102
  663. data/ext/pg_query/include/lib/simplehash.h +0 -1184
  664. data/ext/pg_query/include/lib/sort_template.h +0 -432
  665. data/ext/pg_query/include/lib/stringinfo.h +0 -161
  666. data/ext/pg_query/include/libpq/auth.h +0 -37
  667. data/ext/pg_query/include/libpq/crypt.h +0 -47
  668. data/ext/pg_query/include/libpq/hba.h +0 -186
  669. data/ext/pg_query/include/libpq/libpq-be.h +0 -354
  670. data/ext/pg_query/include/libpq/libpq.h +0 -144
  671. data/ext/pg_query/include/libpq/pqcomm.h +0 -163
  672. data/ext/pg_query/include/libpq/pqformat.h +0 -210
  673. data/ext/pg_query/include/libpq/pqsignal.h +0 -54
  674. data/ext/pg_query/include/libpq/sasl.h +0 -136
  675. data/ext/pg_query/include/libpq/scram.h +0 -37
  676. data/ext/pg_query/include/mb/pg_wchar.h +0 -772
  677. data/ext/pg_query/include/mb/stringinfo_mb.h +0 -24
  678. data/ext/pg_query/include/miscadmin.h +0 -507
  679. data/ext/pg_query/include/nodes/bitmapset.h +0 -126
  680. data/ext/pg_query/include/nodes/execnodes.h +0 -2768
  681. data/ext/pg_query/include/nodes/extensible.h +0 -164
  682. data/ext/pg_query/include/nodes/lockoptions.h +0 -61
  683. data/ext/pg_query/include/nodes/makefuncs.h +0 -121
  684. data/ext/pg_query/include/nodes/memnodes.h +0 -113
  685. data/ext/pg_query/include/nodes/miscnodes.h +0 -56
  686. data/ext/pg_query/include/nodes/nodeFuncs.h +0 -222
  687. data/ext/pg_query/include/nodes/nodes.h +0 -446
  688. data/ext/pg_query/include/nodes/nodetags.h +0 -471
  689. data/ext/pg_query/include/nodes/params.h +0 -170
  690. data/ext/pg_query/include/nodes/parsenodes.h +0 -4050
  691. data/ext/pg_query/include/nodes/pathnodes.h +0 -3384
  692. data/ext/pg_query/include/nodes/pg_list.h +0 -635
  693. data/ext/pg_query/include/nodes/plannodes.h +0 -1592
  694. data/ext/pg_query/include/nodes/primnodes.h +0 -2041
  695. data/ext/pg_query/include/nodes/print.h +0 -34
  696. data/ext/pg_query/include/nodes/queryjumble.h +0 -86
  697. data/ext/pg_query/include/nodes/replnodes.h +0 -111
  698. data/ext/pg_query/include/nodes/supportnodes.h +0 -346
  699. data/ext/pg_query/include/nodes/tidbitmap.h +0 -75
  700. data/ext/pg_query/include/nodes/value.h +0 -90
  701. data/ext/pg_query/include/optimizer/cost.h +0 -215
  702. data/ext/pg_query/include/optimizer/geqo.h +0 -90
  703. data/ext/pg_query/include/optimizer/geqo_gene.h +0 -45
  704. data/ext/pg_query/include/optimizer/optimizer.h +0 -202
  705. data/ext/pg_query/include/optimizer/paths.h +0 -266
  706. data/ext/pg_query/include/optimizer/planmain.h +0 -117
  707. data/ext/pg_query/include/parser/analyze.h +0 -64
  708. data/ext/pg_query/include/parser/kwlist.h +0 -498
  709. data/ext/pg_query/include/parser/parse_agg.h +0 -65
  710. data/ext/pg_query/include/parser/parse_coerce.h +0 -102
  711. data/ext/pg_query/include/parser/parse_expr.h +0 -25
  712. data/ext/pg_query/include/parser/parse_func.h +0 -74
  713. data/ext/pg_query/include/parser/parse_node.h +0 -357
  714. data/ext/pg_query/include/parser/parse_oper.h +0 -65
  715. data/ext/pg_query/include/parser/parse_relation.h +0 -129
  716. data/ext/pg_query/include/parser/parse_type.h +0 -61
  717. data/ext/pg_query/include/parser/parser.h +0 -68
  718. data/ext/pg_query/include/parser/parsetree.h +0 -61
  719. data/ext/pg_query/include/parser/scanner.h +0 -152
  720. data/ext/pg_query/include/parser/scansup.h +0 -27
  721. data/ext/pg_query/include/partitioning/partdefs.h +0 -26
  722. data/ext/pg_query/include/pg_config.h +0 -843
  723. data/ext/pg_query/include/pg_config_manual.h +0 -372
  724. data/ext/pg_query/include/pg_config_os.h +0 -8
  725. data/ext/pg_query/include/pg_getopt.h +0 -56
  726. data/ext/pg_query/include/pg_trace.h +0 -17
  727. data/ext/pg_query/include/pgstat.h +0 -778
  728. data/ext/pg_query/include/pgtime.h +0 -94
  729. data/ext/pg_query/include/pl_gram.h +0 -385
  730. data/ext/pg_query/include/pl_reserved_kwlist.h +0 -52
  731. data/ext/pg_query/include/pl_reserved_kwlist_d.h +0 -114
  732. data/ext/pg_query/include/pl_unreserved_kwlist.h +0 -112
  733. data/ext/pg_query/include/pl_unreserved_kwlist_d.h +0 -246
  734. data/ext/pg_query/include/plerrcodes.h +0 -998
  735. data/ext/pg_query/include/plpgsql.h +0 -1340
  736. data/ext/pg_query/include/port/atomics/arch-arm.h +0 -32
  737. data/ext/pg_query/include/port/atomics/arch-ppc.h +0 -254
  738. data/ext/pg_query/include/port/atomics/arch-x86.h +0 -252
  739. data/ext/pg_query/include/port/atomics/fallback.h +0 -170
  740. data/ext/pg_query/include/port/atomics/generic-gcc.h +0 -286
  741. data/ext/pg_query/include/port/atomics/generic.h +0 -401
  742. data/ext/pg_query/include/port/atomics.h +0 -519
  743. data/ext/pg_query/include/port/pg_bitutils.h +0 -339
  744. data/ext/pg_query/include/port/pg_bswap.h +0 -161
  745. data/ext/pg_query/include/port/pg_crc32c.h +0 -101
  746. data/ext/pg_query/include/port/simd.h +0 -375
  747. data/ext/pg_query/include/port.h +0 -520
  748. data/ext/pg_query/include/portability/instr_time.h +0 -197
  749. data/ext/pg_query/include/postgres.h +0 -579
  750. data/ext/pg_query/include/postmaster/autovacuum.h +0 -80
  751. data/ext/pg_query/include/postmaster/auxprocess.h +0 -20
  752. data/ext/pg_query/include/postmaster/bgworker.h +0 -162
  753. data/ext/pg_query/include/postmaster/bgworker_internals.h +0 -64
  754. data/ext/pg_query/include/postmaster/bgwriter.h +0 -45
  755. data/ext/pg_query/include/postmaster/fork_process.h +0 -17
  756. data/ext/pg_query/include/postmaster/interrupt.h +0 -32
  757. data/ext/pg_query/include/postmaster/pgarch.h +0 -36
  758. data/ext/pg_query/include/postmaster/postmaster.h +0 -81
  759. data/ext/pg_query/include/postmaster/startup.h +0 -41
  760. data/ext/pg_query/include/postmaster/syslogger.h +0 -103
  761. data/ext/pg_query/include/postmaster/walwriter.h +0 -23
  762. data/ext/pg_query/include/regex/regex.h +0 -189
  763. data/ext/pg_query/include/replication/logicallauncher.h +0 -34
  764. data/ext/pg_query/include/replication/logicalproto.h +0 -274
  765. data/ext/pg_query/include/replication/logicalworker.h +0 -32
  766. data/ext/pg_query/include/replication/origin.h +0 -73
  767. data/ext/pg_query/include/replication/reorderbuffer.h +0 -753
  768. data/ext/pg_query/include/replication/slot.h +0 -249
  769. data/ext/pg_query/include/replication/syncrep.h +0 -109
  770. data/ext/pg_query/include/replication/walreceiver.h +0 -478
  771. data/ext/pg_query/include/replication/walsender.h +0 -74
  772. data/ext/pg_query/include/rewrite/prs2lock.h +0 -46
  773. data/ext/pg_query/include/rewrite/rewriteHandler.h +0 -35
  774. data/ext/pg_query/include/rewrite/rewriteManip.h +0 -96
  775. data/ext/pg_query/include/rewrite/rewriteSupport.h +0 -26
  776. data/ext/pg_query/include/src_backend_nodes_copyfuncs.funcs.c +0 -5321
  777. data/ext/pg_query/include/src_backend_nodes_equalfuncs.funcs.c +0 -3354
  778. data/ext/pg_query/include/storage/backendid.h +0 -37
  779. data/ext/pg_query/include/storage/block.h +0 -108
  780. data/ext/pg_query/include/storage/buf.h +0 -46
  781. data/ext/pg_query/include/storage/bufmgr.h +0 -393
  782. data/ext/pg_query/include/storage/bufpage.h +0 -510
  783. data/ext/pg_query/include/storage/condition_variable.h +0 -73
  784. data/ext/pg_query/include/storage/dsm.h +0 -61
  785. data/ext/pg_query/include/storage/dsm_impl.h +0 -79
  786. data/ext/pg_query/include/storage/fd.h +0 -202
  787. data/ext/pg_query/include/storage/fileset.h +0 -40
  788. data/ext/pg_query/include/storage/ipc.h +0 -84
  789. data/ext/pg_query/include/storage/item.h +0 -19
  790. data/ext/pg_query/include/storage/itemid.h +0 -184
  791. data/ext/pg_query/include/storage/itemptr.h +0 -245
  792. data/ext/pg_query/include/storage/large_object.h +0 -100
  793. data/ext/pg_query/include/storage/latch.h +0 -194
  794. data/ext/pg_query/include/storage/lmgr.h +0 -120
  795. data/ext/pg_query/include/storage/lock.h +0 -624
  796. data/ext/pg_query/include/storage/lockdefs.h +0 -59
  797. data/ext/pg_query/include/storage/lwlock.h +0 -220
  798. data/ext/pg_query/include/storage/lwlocknames.h +0 -50
  799. data/ext/pg_query/include/storage/off.h +0 -57
  800. data/ext/pg_query/include/storage/pg_sema.h +0 -61
  801. data/ext/pg_query/include/storage/pg_shmem.h +0 -92
  802. data/ext/pg_query/include/storage/pmsignal.h +0 -105
  803. data/ext/pg_query/include/storage/predicate.h +0 -87
  804. data/ext/pg_query/include/storage/proc.h +0 -466
  805. data/ext/pg_query/include/storage/procarray.h +0 -99
  806. data/ext/pg_query/include/storage/proclist_types.h +0 -51
  807. data/ext/pg_query/include/storage/procsignal.h +0 -73
  808. data/ext/pg_query/include/storage/relfilelocator.h +0 -99
  809. data/ext/pg_query/include/storage/s_lock.h +0 -867
  810. data/ext/pg_query/include/storage/sharedfileset.h +0 -37
  811. data/ext/pg_query/include/storage/shm_mq.h +0 -86
  812. data/ext/pg_query/include/storage/shm_toc.h +0 -58
  813. data/ext/pg_query/include/storage/shmem.h +0 -59
  814. data/ext/pg_query/include/storage/sinval.h +0 -153
  815. data/ext/pg_query/include/storage/sinvaladt.h +0 -45
  816. data/ext/pg_query/include/storage/smgr.h +0 -113
  817. data/ext/pg_query/include/storage/spin.h +0 -77
  818. data/ext/pg_query/include/storage/standby.h +0 -99
  819. data/ext/pg_query/include/storage/standbydefs.h +0 -74
  820. data/ext/pg_query/include/storage/sync.h +0 -66
  821. data/ext/pg_query/include/tcop/cmdtag.h +0 -63
  822. data/ext/pg_query/include/tcop/cmdtaglist.h +0 -218
  823. data/ext/pg_query/include/tcop/deparse_utility.h +0 -108
  824. data/ext/pg_query/include/tcop/dest.h +0 -147
  825. data/ext/pg_query/include/tcop/fastpath.h +0 -20
  826. data/ext/pg_query/include/tcop/pquery.h +0 -51
  827. data/ext/pg_query/include/tcop/tcopprot.h +0 -94
  828. data/ext/pg_query/include/tcop/utility.h +0 -112
  829. data/ext/pg_query/include/tsearch/ts_cache.h +0 -96
  830. data/ext/pg_query/include/utils/acl.h +0 -278
  831. data/ext/pg_query/include/utils/aclchk_internal.h +0 -45
  832. data/ext/pg_query/include/utils/array.h +0 -482
  833. data/ext/pg_query/include/utils/backend_progress.h +0 -45
  834. data/ext/pg_query/include/utils/backend_status.h +0 -342
  835. data/ext/pg_query/include/utils/builtins.h +0 -136
  836. data/ext/pg_query/include/utils/bytea.h +0 -28
  837. data/ext/pg_query/include/utils/catcache.h +0 -231
  838. data/ext/pg_query/include/utils/date.h +0 -118
  839. data/ext/pg_query/include/utils/datetime.h +0 -364
  840. data/ext/pg_query/include/utils/datum.h +0 -76
  841. data/ext/pg_query/include/utils/dsa.h +0 -127
  842. data/ext/pg_query/include/utils/elog.h +0 -545
  843. data/ext/pg_query/include/utils/errcodes.h +0 -354
  844. data/ext/pg_query/include/utils/expandeddatum.h +0 -170
  845. data/ext/pg_query/include/utils/expandedrecord.h +0 -241
  846. data/ext/pg_query/include/utils/float.h +0 -357
  847. data/ext/pg_query/include/utils/fmgroids.h +0 -3314
  848. data/ext/pg_query/include/utils/fmgrprotos.h +0 -2871
  849. data/ext/pg_query/include/utils/fmgrtab.h +0 -49
  850. data/ext/pg_query/include/utils/guc.h +0 -442
  851. data/ext/pg_query/include/utils/guc_hooks.h +0 -163
  852. data/ext/pg_query/include/utils/guc_tables.h +0 -322
  853. data/ext/pg_query/include/utils/hsearch.h +0 -153
  854. data/ext/pg_query/include/utils/inval.h +0 -68
  855. data/ext/pg_query/include/utils/logtape.h +0 -77
  856. data/ext/pg_query/include/utils/lsyscache.h +0 -212
  857. data/ext/pg_query/include/utils/memdebug.h +0 -82
  858. data/ext/pg_query/include/utils/memutils.h +0 -186
  859. data/ext/pg_query/include/utils/memutils_internal.h +0 -136
  860. data/ext/pg_query/include/utils/memutils_memorychunk.h +0 -237
  861. data/ext/pg_query/include/utils/numeric.h +0 -105
  862. data/ext/pg_query/include/utils/palloc.h +0 -165
  863. data/ext/pg_query/include/utils/partcache.h +0 -103
  864. data/ext/pg_query/include/utils/pg_locale.h +0 -135
  865. data/ext/pg_query/include/utils/pgstat_internal.h +0 -814
  866. data/ext/pg_query/include/utils/pidfile.h +0 -56
  867. data/ext/pg_query/include/utils/plancache.h +0 -236
  868. data/ext/pg_query/include/utils/portal.h +0 -252
  869. data/ext/pg_query/include/utils/queryenvironment.h +0 -74
  870. data/ext/pg_query/include/utils/regproc.h +0 -39
  871. data/ext/pg_query/include/utils/rel.h +0 -712
  872. data/ext/pg_query/include/utils/relcache.h +0 -158
  873. data/ext/pg_query/include/utils/reltrigger.h +0 -81
  874. data/ext/pg_query/include/utils/resowner.h +0 -86
  875. data/ext/pg_query/include/utils/ruleutils.h +0 -52
  876. data/ext/pg_query/include/utils/sharedtuplestore.h +0 -61
  877. data/ext/pg_query/include/utils/snapmgr.h +0 -181
  878. data/ext/pg_query/include/utils/snapshot.h +0 -219
  879. data/ext/pg_query/include/utils/sortsupport.h +0 -391
  880. data/ext/pg_query/include/utils/syscache.h +0 -227
  881. data/ext/pg_query/include/utils/timeout.h +0 -95
  882. data/ext/pg_query/include/utils/timestamp.h +0 -147
  883. data/ext/pg_query/include/utils/tuplesort.h +0 -445
  884. data/ext/pg_query/include/utils/tuplestore.h +0 -91
  885. data/ext/pg_query/include/utils/typcache.h +0 -209
  886. data/ext/pg_query/include/utils/varlena.h +0 -53
  887. data/ext/pg_query/include/utils/wait_event.h +0 -294
  888. data/ext/pg_query/include/utils/xml.h +0 -94
  889. data/ext/pg_query/include/varatt.h +0 -358
  890. data/ext/pg_query/src_backend_postmaster_postmaster.c +0 -2220
  891. data/ext/pg_query/src_port_strnlen.c +0 -39
  892. /data/ext/pg_query/include/{access → postgres/access}/rmgr.h +0 -0
  893. /data/ext/pg_query/include/{commands → postgres/commands}/user.h +0 -0
  894. /data/ext/pg_query/include/{common → postgres/common}/unicode_nonspacing_table.h +0 -0
  895. /data/ext/pg_query/include/{pg_config_ext.h → postgres/pg_config_ext.h} +0 -0
  896. /data/ext/pg_query/include/{postgres_ext.h → postgres/postgres_ext.h} +0 -0
  897. /data/ext/pg_query/include/{utils → postgres/utils}/probes.h +0 -0
  898. /data/ext/pg_query/include/{utils → postgres/utils}/ps_status.h +0 -0
@@ -1,2041 +0,0 @@
1
- /*-------------------------------------------------------------------------
2
- *
3
- * primnodes.h
4
- * Definitions for "primitive" node types, those that are used in more
5
- * than one of the parse/plan/execute stages of the query pipeline.
6
- * Currently, these are mostly nodes for executable expressions
7
- * and join trees.
8
- *
9
- *
10
- * Portions Copyright (c) 1996-2023, PostgreSQL Global Development Group
11
- * Portions Copyright (c) 1994, Regents of the University of California
12
- *
13
- * src/include/nodes/primnodes.h
14
- *
15
- *-------------------------------------------------------------------------
16
- */
17
- #ifndef PRIMNODES_H
18
- #define PRIMNODES_H
19
-
20
- #include "access/attnum.h"
21
- #include "nodes/bitmapset.h"
22
- #include "nodes/pg_list.h"
23
-
24
-
25
- /* ----------------------------------------------------------------
26
- * node definitions
27
- * ----------------------------------------------------------------
28
- */
29
-
30
- /*
31
- * Alias -
32
- * specifies an alias for a range variable; the alias might also
33
- * specify renaming of columns within the table.
34
- *
35
- * Note: colnames is a list of String nodes. In Alias structs
36
- * associated with RTEs, there may be entries corresponding to dropped
37
- * columns; these are normally empty strings (""). See parsenodes.h for info.
38
- */
39
- typedef struct Alias
40
- {
41
- NodeTag type;
42
- char *aliasname; /* aliased rel name (never qualified) */
43
- List *colnames; /* optional list of column aliases */
44
- } Alias;
45
-
46
- /* What to do at commit time for temporary relations */
47
- typedef enum OnCommitAction
48
- {
49
- ONCOMMIT_NOOP, /* No ON COMMIT clause (do nothing) */
50
- ONCOMMIT_PRESERVE_ROWS, /* ON COMMIT PRESERVE ROWS (do nothing) */
51
- ONCOMMIT_DELETE_ROWS, /* ON COMMIT DELETE ROWS */
52
- ONCOMMIT_DROP /* ON COMMIT DROP */
53
- } OnCommitAction;
54
-
55
- /*
56
- * RangeVar - range variable, used in FROM clauses
57
- *
58
- * Also used to represent table names in utility statements; there, the alias
59
- * field is not used, and inh tells whether to apply the operation
60
- * recursively to child tables. In some contexts it is also useful to carry
61
- * a TEMP table indication here.
62
- */
63
- typedef struct RangeVar
64
- {
65
- NodeTag type;
66
-
67
- /* the catalog (database) name, or NULL */
68
- char *catalogname;
69
-
70
- /* the schema name, or NULL */
71
- char *schemaname;
72
-
73
- /* the relation/sequence name */
74
- char *relname;
75
-
76
- /* expand rel by inheritance? recursively act on children? */
77
- bool inh;
78
-
79
- /* see RELPERSISTENCE_* in pg_class.h */
80
- char relpersistence;
81
-
82
- /* table alias & optional column aliases */
83
- Alias *alias;
84
-
85
- /* token location, or -1 if unknown */
86
- int location;
87
- } RangeVar;
88
-
89
- /*
90
- * TableFunc - node for a table function, such as XMLTABLE.
91
- *
92
- * Entries in the ns_names list are either String nodes containing
93
- * literal namespace names, or NULL pointers to represent DEFAULT.
94
- */
95
- typedef struct TableFunc
96
- {
97
- NodeTag type;
98
- /* list of namespace URI expressions */
99
- List *ns_uris pg_node_attr(query_jumble_ignore);
100
- /* list of namespace names or NULL */
101
- List *ns_names pg_node_attr(query_jumble_ignore);
102
- /* input document expression */
103
- Node *docexpr;
104
- /* row filter expression */
105
- Node *rowexpr;
106
- /* column names (list of String) */
107
- List *colnames pg_node_attr(query_jumble_ignore);
108
- /* OID list of column type OIDs */
109
- List *coltypes pg_node_attr(query_jumble_ignore);
110
- /* integer list of column typmods */
111
- List *coltypmods pg_node_attr(query_jumble_ignore);
112
- /* OID list of column collation OIDs */
113
- List *colcollations pg_node_attr(query_jumble_ignore);
114
- /* list of column filter expressions */
115
- List *colexprs;
116
- /* list of column default expressions */
117
- List *coldefexprs pg_node_attr(query_jumble_ignore);
118
- /* nullability flag for each output column */
119
- Bitmapset *notnulls pg_node_attr(query_jumble_ignore);
120
- /* counts from 0; -1 if none specified */
121
- int ordinalitycol pg_node_attr(query_jumble_ignore);
122
- /* token location, or -1 if unknown */
123
- int location;
124
- } TableFunc;
125
-
126
- /*
127
- * IntoClause - target information for SELECT INTO, CREATE TABLE AS, and
128
- * CREATE MATERIALIZED VIEW
129
- *
130
- * For CREATE MATERIALIZED VIEW, viewQuery is the parsed-but-not-rewritten
131
- * SELECT Query for the view; otherwise it's NULL. This is irrelevant in
132
- * the query jumbling as CreateTableAsStmt already includes a reference to
133
- * its own Query, so ignore it. (Although it's actually Query*, we declare
134
- * it as Node* to avoid a forward reference.)
135
- */
136
- typedef struct IntoClause
137
- {
138
- NodeTag type;
139
-
140
- RangeVar *rel; /* target relation name */
141
- List *colNames; /* column names to assign, or NIL */
142
- char *accessMethod; /* table access method */
143
- List *options; /* options from WITH clause */
144
- OnCommitAction onCommit; /* what do we do at COMMIT? */
145
- char *tableSpaceName; /* table space to use, or NULL */
146
- /* materialized view's SELECT query */
147
- Node *viewQuery pg_node_attr(query_jumble_ignore);
148
- bool skipData; /* true for WITH NO DATA */
149
- } IntoClause;
150
-
151
-
152
- /* ----------------------------------------------------------------
153
- * node types for executable expressions
154
- * ----------------------------------------------------------------
155
- */
156
-
157
- /*
158
- * Expr - generic superclass for executable-expression nodes
159
- *
160
- * All node types that are used in executable expression trees should derive
161
- * from Expr (that is, have Expr as their first field). Since Expr only
162
- * contains NodeTag, this is a formality, but it is an easy form of
163
- * documentation. See also the ExprState node types in execnodes.h.
164
- */
165
- typedef struct Expr
166
- {
167
- pg_node_attr(abstract)
168
-
169
- NodeTag type;
170
- } Expr;
171
-
172
- /*
173
- * Var - expression node representing a variable (ie, a table column)
174
- *
175
- * In the parser and planner, varno and varattno identify the semantic
176
- * referent, which is a base-relation column unless the reference is to a join
177
- * USING column that isn't semantically equivalent to either join input column
178
- * (because it is a FULL join or the input column requires a type coercion).
179
- * In those cases varno and varattno refer to the JOIN RTE. (Early in the
180
- * planner, we replace such join references by the implied expression; but up
181
- * till then we want join reference Vars to keep their original identity for
182
- * query-printing purposes.)
183
- *
184
- * At the end of planning, Var nodes appearing in upper-level plan nodes are
185
- * reassigned to point to the outputs of their subplans; for example, in a
186
- * join node varno becomes INNER_VAR or OUTER_VAR and varattno becomes the
187
- * index of the proper element of that subplan's target list. Similarly,
188
- * INDEX_VAR is used to identify Vars that reference an index column rather
189
- * than a heap column. (In ForeignScan and CustomScan plan nodes, INDEX_VAR
190
- * is abused to signify references to columns of a custom scan tuple type.)
191
- *
192
- * ROWID_VAR is used in the planner to identify nonce variables that carry
193
- * row identity information during UPDATE/DELETE/MERGE. This value should
194
- * never be seen outside the planner.
195
- *
196
- * varnullingrels is the set of RT indexes of outer joins that can force
197
- * the Var's value to null (at the point where it appears in the query).
198
- * See optimizer/README for discussion of that.
199
- *
200
- * varlevelsup is greater than zero in Vars that represent outer references.
201
- * Note that it affects the meaning of all of varno, varnullingrels, and
202
- * varnosyn, all of which refer to the range table of that query level.
203
- *
204
- * In the parser, varnosyn and varattnosyn are either identical to
205
- * varno/varattno, or they specify the column's position in an aliased JOIN
206
- * RTE that hides the semantic referent RTE's refname. This is a syntactic
207
- * identifier as opposed to the semantic identifier; it tells ruleutils.c
208
- * how to print the Var properly. varnosyn/varattnosyn retain their values
209
- * throughout planning and execution, so they are particularly helpful to
210
- * identify Vars when debugging. Note, however, that a Var that is generated
211
- * in the planner and doesn't correspond to any simple relation column may
212
- * have varnosyn = varattnosyn = 0.
213
- */
214
- #define INNER_VAR (-1) /* reference to inner subplan */
215
- #define OUTER_VAR (-2) /* reference to outer subplan */
216
- #define INDEX_VAR (-3) /* reference to index column */
217
- #define ROWID_VAR (-4) /* row identity column during planning */
218
-
219
- #define IS_SPECIAL_VARNO(varno) ((int) (varno) < 0)
220
-
221
- /* Symbols for the indexes of the special RTE entries in rules */
222
- #define PRS2_OLD_VARNO 1
223
- #define PRS2_NEW_VARNO 2
224
-
225
- typedef struct Var
226
- {
227
- Expr xpr;
228
-
229
- /*
230
- * index of this var's relation in the range table, or
231
- * INNER_VAR/OUTER_VAR/etc
232
- */
233
- int varno;
234
-
235
- /*
236
- * attribute number of this var, or zero for all attrs ("whole-row Var")
237
- */
238
- AttrNumber varattno;
239
-
240
- /* pg_type OID for the type of this var */
241
- Oid vartype pg_node_attr(query_jumble_ignore);
242
- /* pg_attribute typmod value */
243
- int32 vartypmod pg_node_attr(query_jumble_ignore);
244
- /* OID of collation, or InvalidOid if none */
245
- Oid varcollid pg_node_attr(query_jumble_ignore);
246
-
247
- /*
248
- * RT indexes of outer joins that can replace the Var's value with null.
249
- * We can omit varnullingrels in the query jumble, because it's fully
250
- * determined by varno/varlevelsup plus the Var's query location.
251
- */
252
- Bitmapset *varnullingrels pg_node_attr(query_jumble_ignore);
253
-
254
- /*
255
- * for subquery variables referencing outer relations; 0 in a normal var,
256
- * >0 means N levels up
257
- */
258
- Index varlevelsup;
259
-
260
- /*
261
- * varnosyn/varattnosyn are ignored for equality, because Vars with
262
- * different syntactic identifiers are semantically the same as long as
263
- * their varno/varattno match.
264
- */
265
- /* syntactic relation index (0 if unknown) */
266
- Index varnosyn pg_node_attr(equal_ignore, query_jumble_ignore);
267
- /* syntactic attribute number */
268
- AttrNumber varattnosyn pg_node_attr(equal_ignore, query_jumble_ignore);
269
-
270
- /* token location, or -1 if unknown */
271
- int location;
272
- } Var;
273
-
274
- /*
275
- * Const
276
- *
277
- * Note: for varlena data types, we make a rule that a Const node's value
278
- * must be in non-extended form (4-byte header, no compression or external
279
- * references). This ensures that the Const node is self-contained and makes
280
- * it more likely that equal() will see logically identical values as equal.
281
- *
282
- * Only the constant type OID is relevant for the query jumbling.
283
- */
284
- typedef struct Const
285
- {
286
- pg_node_attr(custom_copy_equal, custom_read_write)
287
-
288
- Expr xpr;
289
- /* pg_type OID of the constant's datatype */
290
- Oid consttype;
291
- /* typmod value, if any */
292
- int32 consttypmod pg_node_attr(query_jumble_ignore);
293
- /* OID of collation, or InvalidOid if none */
294
- Oid constcollid pg_node_attr(query_jumble_ignore);
295
- /* typlen of the constant's datatype */
296
- int constlen pg_node_attr(query_jumble_ignore);
297
- /* the constant's value */
298
- Datum constvalue pg_node_attr(query_jumble_ignore);
299
- /* whether the constant is null (if true, constvalue is undefined) */
300
- bool constisnull pg_node_attr(query_jumble_ignore);
301
-
302
- /*
303
- * Whether this datatype is passed by value. If true, then all the
304
- * information is stored in the Datum. If false, then the Datum contains
305
- * a pointer to the information.
306
- */
307
- bool constbyval pg_node_attr(query_jumble_ignore);
308
-
309
- /*
310
- * token location, or -1 if unknown. All constants are tracked as
311
- * locations in query jumbling, to be marked as parameters.
312
- */
313
- int location pg_node_attr(query_jumble_location);
314
- } Const;
315
-
316
- /*
317
- * Param
318
- *
319
- * paramkind specifies the kind of parameter. The possible values
320
- * for this field are:
321
- *
322
- * PARAM_EXTERN: The parameter value is supplied from outside the plan.
323
- * Such parameters are numbered from 1 to n.
324
- *
325
- * PARAM_EXEC: The parameter is an internal executor parameter, used
326
- * for passing values into and out of sub-queries or from
327
- * nestloop joins to their inner scans.
328
- * For historical reasons, such parameters are numbered from 0.
329
- * These numbers are independent of PARAM_EXTERN numbers.
330
- *
331
- * PARAM_SUBLINK: The parameter represents an output column of a SubLink
332
- * node's sub-select. The column number is contained in the
333
- * `paramid' field. (This type of Param is converted to
334
- * PARAM_EXEC during planning.)
335
- *
336
- * PARAM_MULTIEXPR: Like PARAM_SUBLINK, the parameter represents an
337
- * output column of a SubLink node's sub-select, but here, the
338
- * SubLink is always a MULTIEXPR SubLink. The high-order 16 bits
339
- * of the `paramid' field contain the SubLink's subLinkId, and
340
- * the low-order 16 bits contain the column number. (This type
341
- * of Param is also converted to PARAM_EXEC during planning.)
342
- */
343
- typedef enum ParamKind
344
- {
345
- PARAM_EXTERN,
346
- PARAM_EXEC,
347
- PARAM_SUBLINK,
348
- PARAM_MULTIEXPR
349
- } ParamKind;
350
-
351
- typedef struct Param
352
- {
353
- Expr xpr;
354
- ParamKind paramkind; /* kind of parameter. See above */
355
- int paramid; /* numeric ID for parameter */
356
- Oid paramtype; /* pg_type OID of parameter's datatype */
357
- /* typmod value, if known */
358
- int32 paramtypmod pg_node_attr(query_jumble_ignore);
359
- /* OID of collation, or InvalidOid if none */
360
- Oid paramcollid pg_node_attr(query_jumble_ignore);
361
- /* token location, or -1 if unknown */
362
- int location;
363
- } Param;
364
-
365
- /*
366
- * Aggref
367
- *
368
- * The aggregate's args list is a targetlist, ie, a list of TargetEntry nodes.
369
- *
370
- * For a normal (non-ordered-set) aggregate, the non-resjunk TargetEntries
371
- * represent the aggregate's regular arguments (if any) and resjunk TLEs can
372
- * be added at the end to represent ORDER BY expressions that are not also
373
- * arguments. As in a top-level Query, the TLEs can be marked with
374
- * ressortgroupref indexes to let them be referenced by SortGroupClause
375
- * entries in the aggorder and/or aggdistinct lists. This represents ORDER BY
376
- * and DISTINCT operations to be applied to the aggregate input rows before
377
- * they are passed to the transition function. The grammar only allows a
378
- * simple "DISTINCT" specifier for the arguments, but we use the full
379
- * query-level representation to allow more code sharing.
380
- *
381
- * For an ordered-set aggregate, the args list represents the WITHIN GROUP
382
- * (aggregated) arguments, all of which will be listed in the aggorder list.
383
- * DISTINCT is not supported in this case, so aggdistinct will be NIL.
384
- * The direct arguments appear in aggdirectargs (as a list of plain
385
- * expressions, not TargetEntry nodes).
386
- *
387
- * aggtranstype is the data type of the state transition values for this
388
- * aggregate (resolved to an actual type, if agg's transtype is polymorphic).
389
- * This is determined during planning and is InvalidOid before that.
390
- *
391
- * aggargtypes is an OID list of the data types of the direct and regular
392
- * arguments. Normally it's redundant with the aggdirectargs and args lists,
393
- * but in a combining aggregate, it's not because the args list has been
394
- * replaced with a single argument representing the partial-aggregate
395
- * transition values.
396
- *
397
- * aggpresorted is set by the query planner for ORDER BY and DISTINCT
398
- * aggregates where the chosen plan provides presorted input for this
399
- * aggregate during execution.
400
- *
401
- * aggsplit indicates the expected partial-aggregation mode for the Aggref's
402
- * parent plan node. It's always set to AGGSPLIT_SIMPLE in the parser, but
403
- * the planner might change it to something else. We use this mainly as
404
- * a crosscheck that the Aggrefs match the plan; but note that when aggsplit
405
- * indicates a non-final mode, aggtype reflects the transition data type
406
- * not the SQL-level output type of the aggregate.
407
- *
408
- * aggno and aggtransno are -1 in the parse stage, and are set in planning.
409
- * Aggregates with the same 'aggno' represent the same aggregate expression,
410
- * and can share the result. Aggregates with same 'transno' but different
411
- * 'aggno' can share the same transition state, only the final function needs
412
- * to be called separately.
413
- *
414
- * Information related to collations, transition types and internal states
415
- * are irrelevant for the query jumbling.
416
- */
417
- typedef struct Aggref
418
- {
419
- Expr xpr;
420
-
421
- /* pg_proc Oid of the aggregate */
422
- Oid aggfnoid;
423
-
424
- /* type Oid of result of the aggregate */
425
- Oid aggtype pg_node_attr(query_jumble_ignore);
426
-
427
- /* OID of collation of result */
428
- Oid aggcollid pg_node_attr(query_jumble_ignore);
429
-
430
- /* OID of collation that function should use */
431
- Oid inputcollid pg_node_attr(query_jumble_ignore);
432
-
433
- /*
434
- * type Oid of aggregate's transition value; ignored for equal since it
435
- * might not be set yet
436
- */
437
- Oid aggtranstype pg_node_attr(equal_ignore, query_jumble_ignore);
438
-
439
- /* type Oids of direct and aggregated args */
440
- List *aggargtypes pg_node_attr(query_jumble_ignore);
441
-
442
- /* direct arguments, if an ordered-set agg */
443
- List *aggdirectargs;
444
-
445
- /* aggregated arguments and sort expressions */
446
- List *args;
447
-
448
- /* ORDER BY (list of SortGroupClause) */
449
- List *aggorder;
450
-
451
- /* DISTINCT (list of SortGroupClause) */
452
- List *aggdistinct;
453
-
454
- /* FILTER expression, if any */
455
- Expr *aggfilter;
456
-
457
- /* true if argument list was really '*' */
458
- bool aggstar pg_node_attr(query_jumble_ignore);
459
-
460
- /*
461
- * true if variadic arguments have been combined into an array last
462
- * argument
463
- */
464
- bool aggvariadic pg_node_attr(query_jumble_ignore);
465
-
466
- /* aggregate kind (see pg_aggregate.h) */
467
- char aggkind pg_node_attr(query_jumble_ignore);
468
-
469
- /* aggregate input already sorted */
470
- bool aggpresorted pg_node_attr(equal_ignore, query_jumble_ignore);
471
-
472
- /* > 0 if agg belongs to outer query */
473
- Index agglevelsup pg_node_attr(query_jumble_ignore);
474
-
475
- /* expected agg-splitting mode of parent Agg */
476
- AggSplit aggsplit pg_node_attr(query_jumble_ignore);
477
-
478
- /* unique ID within the Agg node */
479
- int aggno pg_node_attr(query_jumble_ignore);
480
-
481
- /* unique ID of transition state in the Agg */
482
- int aggtransno pg_node_attr(query_jumble_ignore);
483
-
484
- /* token location, or -1 if unknown */
485
- int location;
486
- } Aggref;
487
-
488
- /*
489
- * GroupingFunc
490
- *
491
- * A GroupingFunc is a GROUPING(...) expression, which behaves in many ways
492
- * like an aggregate function (e.g. it "belongs" to a specific query level,
493
- * which might not be the one immediately containing it), but also differs in
494
- * an important respect: it never evaluates its arguments, they merely
495
- * designate expressions from the GROUP BY clause of the query level to which
496
- * it belongs.
497
- *
498
- * The spec defines the evaluation of GROUPING() purely by syntactic
499
- * replacement, but we make it a real expression for optimization purposes so
500
- * that one Agg node can handle multiple grouping sets at once. Evaluating the
501
- * result only needs the column positions to check against the grouping set
502
- * being projected. However, for EXPLAIN to produce meaningful output, we have
503
- * to keep the original expressions around, since expression deparse does not
504
- * give us any feasible way to get at the GROUP BY clause.
505
- *
506
- * Also, we treat two GroupingFunc nodes as equal if they have equal arguments
507
- * lists and agglevelsup, without comparing the refs and cols annotations.
508
- *
509
- * In raw parse output we have only the args list; parse analysis fills in the
510
- * refs list, and the planner fills in the cols list.
511
- *
512
- * All the fields used as information for an internal state are irrelevant
513
- * for the query jumbling.
514
- */
515
- typedef struct GroupingFunc
516
- {
517
- Expr xpr;
518
-
519
- /* arguments, not evaluated but kept for benefit of EXPLAIN etc. */
520
- List *args pg_node_attr(query_jumble_ignore);
521
-
522
- /* ressortgrouprefs of arguments */
523
- List *refs pg_node_attr(equal_ignore);
524
-
525
- /* actual column positions set by planner */
526
- List *cols pg_node_attr(equal_ignore, query_jumble_ignore);
527
-
528
- /* same as Aggref.agglevelsup */
529
- Index agglevelsup;
530
-
531
- /* token location */
532
- int location;
533
- } GroupingFunc;
534
-
535
- /*
536
- * WindowFunc
537
- *
538
- * Collation information is irrelevant for the query jumbling, as is the
539
- * internal state information of the node like "winstar" and "winagg".
540
- */
541
- typedef struct WindowFunc
542
- {
543
- Expr xpr;
544
- /* pg_proc Oid of the function */
545
- Oid winfnoid;
546
- /* type Oid of result of the window function */
547
- Oid wintype pg_node_attr(query_jumble_ignore);
548
- /* OID of collation of result */
549
- Oid wincollid pg_node_attr(query_jumble_ignore);
550
- /* OID of collation that function should use */
551
- Oid inputcollid pg_node_attr(query_jumble_ignore);
552
- /* arguments to the window function */
553
- List *args;
554
- /* FILTER expression, if any */
555
- Expr *aggfilter;
556
- /* index of associated WindowClause */
557
- Index winref;
558
- /* true if argument list was really '*' */
559
- bool winstar pg_node_attr(query_jumble_ignore);
560
- /* is function a simple aggregate? */
561
- bool winagg pg_node_attr(query_jumble_ignore);
562
- /* token location, or -1 if unknown */
563
- int location;
564
- } WindowFunc;
565
-
566
- /*
567
- * SubscriptingRef: describes a subscripting operation over a container
568
- * (array, etc).
569
- *
570
- * A SubscriptingRef can describe fetching a single element from a container,
571
- * fetching a part of a container (e.g. an array slice), storing a single
572
- * element into a container, or storing a slice. The "store" cases work with
573
- * an initial container value and a source value that is inserted into the
574
- * appropriate part of the container; the result of the operation is an
575
- * entire new modified container value.
576
- *
577
- * If reflowerindexpr = NIL, then we are fetching or storing a single container
578
- * element at the subscripts given by refupperindexpr. Otherwise we are
579
- * fetching or storing a container slice, that is a rectangular subcontainer
580
- * with lower and upper bounds given by the index expressions.
581
- * reflowerindexpr must be the same length as refupperindexpr when it
582
- * is not NIL.
583
- *
584
- * In the slice case, individual expressions in the subscript lists can be
585
- * NULL, meaning "substitute the array's current lower or upper bound".
586
- * (Non-array containers may or may not support this.)
587
- *
588
- * refcontainertype is the actual container type that determines the
589
- * subscripting semantics. (This will generally be either the exposed type of
590
- * refexpr, or the base type if that is a domain.) refelemtype is the type of
591
- * the container's elements; this is saved for the use of the subscripting
592
- * functions, but is not used by the core code. refrestype, reftypmod, and
593
- * refcollid describe the type of the SubscriptingRef's result. In a store
594
- * expression, refrestype will always match refcontainertype; in a fetch,
595
- * it could be refelemtype for an element fetch, or refcontainertype for a
596
- * slice fetch, or possibly something else as determined by type-specific
597
- * subscripting logic. Likewise, reftypmod and refcollid will match the
598
- * container's properties in a store, but could be different in a fetch.
599
- *
600
- * Any internal state data is ignored for the query jumbling.
601
- *
602
- * Note: for the cases where a container is returned, if refexpr yields a R/W
603
- * expanded container, then the implementation is allowed to modify that
604
- * object in-place and return the same object.
605
- */
606
- typedef struct SubscriptingRef
607
- {
608
- Expr xpr;
609
- /* type of the container proper */
610
- Oid refcontainertype pg_node_attr(query_jumble_ignore);
611
- /* the container type's pg_type.typelem */
612
- Oid refelemtype pg_node_attr(query_jumble_ignore);
613
- /* type of the SubscriptingRef's result */
614
- Oid refrestype pg_node_attr(query_jumble_ignore);
615
- /* typmod of the result */
616
- int32 reftypmod pg_node_attr(query_jumble_ignore);
617
- /* collation of result, or InvalidOid if none */
618
- Oid refcollid pg_node_attr(query_jumble_ignore);
619
- /* expressions that evaluate to upper container indexes */
620
- List *refupperindexpr;
621
-
622
- /*
623
- * expressions that evaluate to lower container indexes, or NIL for single
624
- * container element.
625
- */
626
- List *reflowerindexpr;
627
- /* the expression that evaluates to a container value */
628
- Expr *refexpr;
629
- /* expression for the source value, or NULL if fetch */
630
- Expr *refassgnexpr;
631
- } SubscriptingRef;
632
-
633
- /*
634
- * CoercionContext - distinguishes the allowed set of type casts
635
- *
636
- * NB: ordering of the alternatives is significant; later (larger) values
637
- * allow more casts than earlier ones.
638
- */
639
- typedef enum CoercionContext
640
- {
641
- COERCION_IMPLICIT, /* coercion in context of expression */
642
- COERCION_ASSIGNMENT, /* coercion in context of assignment */
643
- COERCION_PLPGSQL, /* if no assignment cast, use CoerceViaIO */
644
- COERCION_EXPLICIT /* explicit cast operation */
645
- } CoercionContext;
646
-
647
- /*
648
- * CoercionForm - how to display a FuncExpr or related node
649
- *
650
- * "Coercion" is a bit of a misnomer, since this value records other
651
- * special syntaxes besides casts, but for now we'll keep this naming.
652
- *
653
- * NB: equal() ignores CoercionForm fields, therefore this *must* not carry
654
- * any semantically significant information. We need that behavior so that
655
- * the planner will consider equivalent implicit and explicit casts to be
656
- * equivalent. In cases where those actually behave differently, the coercion
657
- * function's arguments will be different.
658
- */
659
- typedef enum CoercionForm
660
- {
661
- COERCE_EXPLICIT_CALL, /* display as a function call */
662
- COERCE_EXPLICIT_CAST, /* display as an explicit cast */
663
- COERCE_IMPLICIT_CAST, /* implicit cast, so hide it */
664
- COERCE_SQL_SYNTAX /* display with SQL-mandated special syntax */
665
- } CoercionForm;
666
-
667
- /*
668
- * FuncExpr - expression node for a function call
669
- *
670
- * Collation information is irrelevant for the query jumbling, only the
671
- * arguments and the function OID matter.
672
- */
673
- typedef struct FuncExpr
674
- {
675
- Expr xpr;
676
- /* PG_PROC OID of the function */
677
- Oid funcid;
678
- /* PG_TYPE OID of result value */
679
- Oid funcresulttype pg_node_attr(query_jumble_ignore);
680
- /* true if function returns set */
681
- bool funcretset pg_node_attr(query_jumble_ignore);
682
-
683
- /*
684
- * true if variadic arguments have been combined into an array last
685
- * argument
686
- */
687
- bool funcvariadic pg_node_attr(query_jumble_ignore);
688
- /* how to display this function call */
689
- CoercionForm funcformat pg_node_attr(query_jumble_ignore);
690
- /* OID of collation of result */
691
- Oid funccollid pg_node_attr(query_jumble_ignore);
692
- /* OID of collation that function should use */
693
- Oid inputcollid pg_node_attr(query_jumble_ignore);
694
- /* arguments to the function */
695
- List *args;
696
- /* token location, or -1 if unknown */
697
- int location;
698
- } FuncExpr;
699
-
700
- /*
701
- * NamedArgExpr - a named argument of a function
702
- *
703
- * This node type can only appear in the args list of a FuncCall or FuncExpr
704
- * node. We support pure positional call notation (no named arguments),
705
- * named notation (all arguments are named), and mixed notation (unnamed
706
- * arguments followed by named ones).
707
- *
708
- * Parse analysis sets argnumber to the positional index of the argument,
709
- * but doesn't rearrange the argument list.
710
- *
711
- * The planner will convert argument lists to pure positional notation
712
- * during expression preprocessing, so execution never sees a NamedArgExpr.
713
- */
714
- typedef struct NamedArgExpr
715
- {
716
- Expr xpr;
717
- /* the argument expression */
718
- Expr *arg;
719
- /* the name */
720
- char *name pg_node_attr(query_jumble_ignore);
721
- /* argument's number in positional notation */
722
- int argnumber;
723
- /* argument name location, or -1 if unknown */
724
- int location;
725
- } NamedArgExpr;
726
-
727
- /*
728
- * OpExpr - expression node for an operator invocation
729
- *
730
- * Semantically, this is essentially the same as a function call.
731
- *
732
- * Note that opfuncid is not necessarily filled in immediately on creation
733
- * of the node. The planner makes sure it is valid before passing the node
734
- * tree to the executor, but during parsing/planning opfuncid can be 0.
735
- * Therefore, equal() will accept a zero value as being equal to other values.
736
- *
737
- * Internal state information and collation data is irrelevant for the query
738
- * jumbling.
739
- */
740
- typedef struct OpExpr
741
- {
742
- Expr xpr;
743
-
744
- /* PG_OPERATOR OID of the operator */
745
- Oid opno;
746
-
747
- /* PG_PROC OID of underlying function */
748
- Oid opfuncid pg_node_attr(equal_ignore_if_zero, query_jumble_ignore);
749
-
750
- /* PG_TYPE OID of result value */
751
- Oid opresulttype pg_node_attr(query_jumble_ignore);
752
-
753
- /* true if operator returns set */
754
- bool opretset pg_node_attr(query_jumble_ignore);
755
-
756
- /* OID of collation of result */
757
- Oid opcollid pg_node_attr(query_jumble_ignore);
758
-
759
- /* OID of collation that operator should use */
760
- Oid inputcollid pg_node_attr(query_jumble_ignore);
761
-
762
- /* arguments to the operator (1 or 2) */
763
- List *args;
764
-
765
- /* token location, or -1 if unknown */
766
- int location;
767
- } OpExpr;
768
-
769
- /*
770
- * DistinctExpr - expression node for "x IS DISTINCT FROM y"
771
- *
772
- * Except for the nodetag, this is represented identically to an OpExpr
773
- * referencing the "=" operator for x and y.
774
- * We use "=", not the more obvious "<>", because more datatypes have "="
775
- * than "<>". This means the executor must invert the operator result.
776
- * Note that the operator function won't be called at all if either input
777
- * is NULL, since then the result can be determined directly.
778
- */
779
- typedef OpExpr DistinctExpr;
780
-
781
- /*
782
- * NullIfExpr - a NULLIF expression
783
- *
784
- * Like DistinctExpr, this is represented the same as an OpExpr referencing
785
- * the "=" operator for x and y.
786
- */
787
- typedef OpExpr NullIfExpr;
788
-
789
- /*
790
- * ScalarArrayOpExpr - expression node for "scalar op ANY/ALL (array)"
791
- *
792
- * The operator must yield boolean. It is applied to the left operand
793
- * and each element of the righthand array, and the results are combined
794
- * with OR or AND (for ANY or ALL respectively). The node representation
795
- * is almost the same as for the underlying operator, but we need a useOr
796
- * flag to remember whether it's ANY or ALL, and we don't have to store
797
- * the result type (or the collation) because it must be boolean.
798
- *
799
- * A ScalarArrayOpExpr with a valid hashfuncid is evaluated during execution
800
- * by building a hash table containing the Const values from the RHS arg.
801
- * This table is probed during expression evaluation. The planner will set
802
- * hashfuncid to the hash function which must be used to build and probe the
803
- * hash table. The executor determines if it should use hash-based checks or
804
- * the more traditional means based on if the hashfuncid is set or not.
805
- *
806
- * When performing hashed NOT IN, the negfuncid will also be set to the
807
- * equality function which the hash table must use to build and probe the hash
808
- * table. opno and opfuncid will remain set to the <> operator and its
809
- * corresponding function and won't be used during execution. For
810
- * non-hashtable based NOT INs, negfuncid will be set to InvalidOid. See
811
- * convert_saop_to_hashed_saop().
812
- *
813
- * Similar to OpExpr, opfuncid, hashfuncid, and negfuncid are not necessarily
814
- * filled in right away, so will be ignored for equality if they are not set
815
- * yet.
816
- *
817
- * OID entries of the internal function types are irrelevant for the query
818
- * jumbling, but the operator OID and the arguments are.
819
- */
820
- typedef struct ScalarArrayOpExpr
821
- {
822
- Expr xpr;
823
-
824
- /* PG_OPERATOR OID of the operator */
825
- Oid opno;
826
-
827
- /* PG_PROC OID of comparison function */
828
- Oid opfuncid pg_node_attr(equal_ignore_if_zero, query_jumble_ignore);
829
-
830
- /* PG_PROC OID of hash func or InvalidOid */
831
- Oid hashfuncid pg_node_attr(equal_ignore_if_zero, query_jumble_ignore);
832
-
833
- /* PG_PROC OID of negator of opfuncid function or InvalidOid. See above */
834
- Oid negfuncid pg_node_attr(equal_ignore_if_zero, query_jumble_ignore);
835
-
836
- /* true for ANY, false for ALL */
837
- bool useOr;
838
-
839
- /* OID of collation that operator should use */
840
- Oid inputcollid pg_node_attr(query_jumble_ignore);
841
-
842
- /* the scalar and array operands */
843
- List *args;
844
-
845
- /* token location, or -1 if unknown */
846
- int location;
847
- } ScalarArrayOpExpr;
848
-
849
- /*
850
- * BoolExpr - expression node for the basic Boolean operators AND, OR, NOT
851
- *
852
- * Notice the arguments are given as a List. For NOT, of course the list
853
- * must always have exactly one element. For AND and OR, there can be two
854
- * or more arguments.
855
- */
856
- typedef enum BoolExprType
857
- {
858
- AND_EXPR, OR_EXPR, NOT_EXPR
859
- } BoolExprType;
860
-
861
- typedef struct BoolExpr
862
- {
863
- pg_node_attr(custom_read_write)
864
-
865
- Expr xpr;
866
- BoolExprType boolop;
867
- List *args; /* arguments to this expression */
868
- int location; /* token location, or -1 if unknown */
869
- } BoolExpr;
870
-
871
- /*
872
- * SubLink
873
- *
874
- * A SubLink represents a subselect appearing in an expression, and in some
875
- * cases also the combining operator(s) just above it. The subLinkType
876
- * indicates the form of the expression represented:
877
- * EXISTS_SUBLINK EXISTS(SELECT ...)
878
- * ALL_SUBLINK (lefthand) op ALL (SELECT ...)
879
- * ANY_SUBLINK (lefthand) op ANY (SELECT ...)
880
- * ROWCOMPARE_SUBLINK (lefthand) op (SELECT ...)
881
- * EXPR_SUBLINK (SELECT with single targetlist item ...)
882
- * MULTIEXPR_SUBLINK (SELECT with multiple targetlist items ...)
883
- * ARRAY_SUBLINK ARRAY(SELECT with single targetlist item ...)
884
- * CTE_SUBLINK WITH query (never actually part of an expression)
885
- * For ALL, ANY, and ROWCOMPARE, the lefthand is a list of expressions of the
886
- * same length as the subselect's targetlist. ROWCOMPARE will *always* have
887
- * a list with more than one entry; if the subselect has just one target
888
- * then the parser will create an EXPR_SUBLINK instead (and any operator
889
- * above the subselect will be represented separately).
890
- * ROWCOMPARE, EXPR, and MULTIEXPR require the subselect to deliver at most
891
- * one row (if it returns no rows, the result is NULL).
892
- * ALL, ANY, and ROWCOMPARE require the combining operators to deliver boolean
893
- * results. ALL and ANY combine the per-row results using AND and OR
894
- * semantics respectively.
895
- * ARRAY requires just one target column, and creates an array of the target
896
- * column's type using any number of rows resulting from the subselect.
897
- *
898
- * SubLink is classed as an Expr node, but it is not actually executable;
899
- * it must be replaced in the expression tree by a SubPlan node during
900
- * planning.
901
- *
902
- * NOTE: in the raw output of gram.y, testexpr contains just the raw form
903
- * of the lefthand expression (if any), and operName is the String name of
904
- * the combining operator. Also, subselect is a raw parsetree. During parse
905
- * analysis, the parser transforms testexpr into a complete boolean expression
906
- * that compares the lefthand value(s) to PARAM_SUBLINK nodes representing the
907
- * output columns of the subselect. And subselect is transformed to a Query.
908
- * This is the representation seen in saved rules and in the rewriter.
909
- *
910
- * In EXISTS, EXPR, MULTIEXPR, and ARRAY SubLinks, testexpr and operName
911
- * are unused and are always null.
912
- *
913
- * subLinkId is currently used only for MULTIEXPR SubLinks, and is zero in
914
- * other SubLinks. This number identifies different multiple-assignment
915
- * subqueries within an UPDATE statement's SET list. It is unique only
916
- * within a particular targetlist. The output column(s) of the MULTIEXPR
917
- * are referenced by PARAM_MULTIEXPR Params appearing elsewhere in the tlist.
918
- *
919
- * The CTE_SUBLINK case never occurs in actual SubLink nodes, but it is used
920
- * in SubPlans generated for WITH subqueries.
921
- */
922
- typedef enum SubLinkType
923
- {
924
- EXISTS_SUBLINK,
925
- ALL_SUBLINK,
926
- ANY_SUBLINK,
927
- ROWCOMPARE_SUBLINK,
928
- EXPR_SUBLINK,
929
- MULTIEXPR_SUBLINK,
930
- ARRAY_SUBLINK,
931
- CTE_SUBLINK /* for SubPlans only */
932
- } SubLinkType;
933
-
934
-
935
- typedef struct SubLink
936
- {
937
- Expr xpr;
938
- SubLinkType subLinkType; /* see above */
939
- int subLinkId; /* ID (1..n); 0 if not MULTIEXPR */
940
- Node *testexpr; /* outer-query test for ALL/ANY/ROWCOMPARE */
941
- /* originally specified operator name */
942
- List *operName pg_node_attr(query_jumble_ignore);
943
- /* subselect as Query* or raw parsetree */
944
- Node *subselect;
945
- int location; /* token location, or -1 if unknown */
946
- } SubLink;
947
-
948
- /*
949
- * SubPlan - executable expression node for a subplan (sub-SELECT)
950
- *
951
- * The planner replaces SubLink nodes in expression trees with SubPlan
952
- * nodes after it has finished planning the subquery. SubPlan references
953
- * a sub-plantree stored in the subplans list of the toplevel PlannedStmt.
954
- * (We avoid a direct link to make it easier to copy expression trees
955
- * without causing multiple processing of the subplan.)
956
- *
957
- * In an ordinary subplan, testexpr points to an executable expression
958
- * (OpExpr, an AND/OR tree of OpExprs, or RowCompareExpr) for the combining
959
- * operator(s); the left-hand arguments are the original lefthand expressions,
960
- * and the right-hand arguments are PARAM_EXEC Param nodes representing the
961
- * outputs of the sub-select. (NOTE: runtime coercion functions may be
962
- * inserted as well.) This is just the same expression tree as testexpr in
963
- * the original SubLink node, but the PARAM_SUBLINK nodes are replaced by
964
- * suitably numbered PARAM_EXEC nodes.
965
- *
966
- * If the sub-select becomes an initplan rather than a subplan, the executable
967
- * expression is part of the outer plan's expression tree (and the SubPlan
968
- * node itself is not, but rather is found in the outer plan's initPlan
969
- * list). In this case testexpr is NULL to avoid duplication.
970
- *
971
- * The planner also derives lists of the values that need to be passed into
972
- * and out of the subplan. Input values are represented as a list "args" of
973
- * expressions to be evaluated in the outer-query context (currently these
974
- * args are always just Vars, but in principle they could be any expression).
975
- * The values are assigned to the global PARAM_EXEC params indexed by parParam
976
- * (the parParam and args lists must have the same ordering). setParam is a
977
- * list of the PARAM_EXEC params that are computed by the sub-select, if it
978
- * is an initplan or MULTIEXPR plan; they are listed in order by sub-select
979
- * output column position. (parParam and setParam are integer Lists, not
980
- * Bitmapsets, because their ordering is significant.)
981
- *
982
- * Also, the planner computes startup and per-call costs for use of the
983
- * SubPlan. Note that these include the cost of the subquery proper,
984
- * evaluation of the testexpr if any, and any hashtable management overhead.
985
- */
986
- typedef struct SubPlan
987
- {
988
- pg_node_attr(no_query_jumble)
989
-
990
- Expr xpr;
991
- /* Fields copied from original SubLink: */
992
- SubLinkType subLinkType; /* see above */
993
- /* The combining operators, transformed to an executable expression: */
994
- Node *testexpr; /* OpExpr or RowCompareExpr expression tree */
995
- List *paramIds; /* IDs of Params embedded in the above */
996
- /* Identification of the Plan tree to use: */
997
- int plan_id; /* Index (from 1) in PlannedStmt.subplans */
998
- /* Identification of the SubPlan for EXPLAIN and debugging purposes: */
999
- char *plan_name; /* A name assigned during planning */
1000
- /* Extra data useful for determining subplan's output type: */
1001
- Oid firstColType; /* Type of first column of subplan result */
1002
- int32 firstColTypmod; /* Typmod of first column of subplan result */
1003
- Oid firstColCollation; /* Collation of first column of subplan
1004
- * result */
1005
- /* Information about execution strategy: */
1006
- bool useHashTable; /* true to store subselect output in a hash
1007
- * table (implies we are doing "IN") */
1008
- bool unknownEqFalse; /* true if it's okay to return FALSE when the
1009
- * spec result is UNKNOWN; this allows much
1010
- * simpler handling of null values */
1011
- bool parallel_safe; /* is the subplan parallel-safe? */
1012
- /* Note: parallel_safe does not consider contents of testexpr or args */
1013
- /* Information for passing params into and out of the subselect: */
1014
- /* setParam and parParam are lists of integers (param IDs) */
1015
- List *setParam; /* initplan and MULTIEXPR subqueries have to
1016
- * set these Params for parent plan */
1017
- List *parParam; /* indices of input Params from parent plan */
1018
- List *args; /* exprs to pass as parParam values */
1019
- /* Estimated execution costs: */
1020
- Cost startup_cost; /* one-time setup cost */
1021
- Cost per_call_cost; /* cost for each subplan evaluation */
1022
- } SubPlan;
1023
-
1024
- /*
1025
- * AlternativeSubPlan - expression node for a choice among SubPlans
1026
- *
1027
- * This is used only transiently during planning: by the time the plan
1028
- * reaches the executor, all AlternativeSubPlan nodes have been removed.
1029
- *
1030
- * The subplans are given as a List so that the node definition need not
1031
- * change if there's ever more than two alternatives. For the moment,
1032
- * though, there are always exactly two; and the first one is the fast-start
1033
- * plan.
1034
- */
1035
- typedef struct AlternativeSubPlan
1036
- {
1037
- pg_node_attr(no_query_jumble)
1038
-
1039
- Expr xpr;
1040
- List *subplans; /* SubPlan(s) with equivalent results */
1041
- } AlternativeSubPlan;
1042
-
1043
- /* ----------------
1044
- * FieldSelect
1045
- *
1046
- * FieldSelect represents the operation of extracting one field from a tuple
1047
- * value. At runtime, the input expression is expected to yield a rowtype
1048
- * Datum. The specified field number is extracted and returned as a Datum.
1049
- * ----------------
1050
- */
1051
-
1052
- typedef struct FieldSelect
1053
- {
1054
- Expr xpr;
1055
- Expr *arg; /* input expression */
1056
- AttrNumber fieldnum; /* attribute number of field to extract */
1057
- /* type of the field (result type of this node) */
1058
- Oid resulttype pg_node_attr(query_jumble_ignore);
1059
- /* output typmod (usually -1) */
1060
- int32 resulttypmod pg_node_attr(query_jumble_ignore);
1061
- /* OID of collation of the field */
1062
- Oid resultcollid pg_node_attr(query_jumble_ignore);
1063
- } FieldSelect;
1064
-
1065
- /* ----------------
1066
- * FieldStore
1067
- *
1068
- * FieldStore represents the operation of modifying one field in a tuple
1069
- * value, yielding a new tuple value (the input is not touched!). Like
1070
- * the assign case of SubscriptingRef, this is used to implement UPDATE of a
1071
- * portion of a column.
1072
- *
1073
- * resulttype is always a named composite type (not a domain). To update
1074
- * a composite domain value, apply CoerceToDomain to the FieldStore.
1075
- *
1076
- * A single FieldStore can actually represent updates of several different
1077
- * fields. The parser only generates FieldStores with single-element lists,
1078
- * but the planner will collapse multiple updates of the same base column
1079
- * into one FieldStore.
1080
- * ----------------
1081
- */
1082
-
1083
- typedef struct FieldStore
1084
- {
1085
- Expr xpr;
1086
- Expr *arg; /* input tuple value */
1087
- List *newvals; /* new value(s) for field(s) */
1088
- /* integer list of field attnums */
1089
- List *fieldnums pg_node_attr(query_jumble_ignore);
1090
- /* type of result (same as type of arg) */
1091
- Oid resulttype pg_node_attr(query_jumble_ignore);
1092
- /* Like RowExpr, we deliberately omit a typmod and collation here */
1093
- } FieldStore;
1094
-
1095
- /* ----------------
1096
- * RelabelType
1097
- *
1098
- * RelabelType represents a "dummy" type coercion between two binary-
1099
- * compatible datatypes, such as reinterpreting the result of an OID
1100
- * expression as an int4. It is a no-op at runtime; we only need it
1101
- * to provide a place to store the correct type to be attributed to
1102
- * the expression result during type resolution. (We can't get away
1103
- * with just overwriting the type field of the input expression node,
1104
- * so we need a separate node to show the coercion's result type.)
1105
- * ----------------
1106
- */
1107
-
1108
- typedef struct RelabelType
1109
- {
1110
- Expr xpr;
1111
- Expr *arg; /* input expression */
1112
- Oid resulttype; /* output type of coercion expression */
1113
- /* output typmod (usually -1) */
1114
- int32 resulttypmod pg_node_attr(query_jumble_ignore);
1115
- /* OID of collation, or InvalidOid if none */
1116
- Oid resultcollid pg_node_attr(query_jumble_ignore);
1117
- /* how to display this node */
1118
- CoercionForm relabelformat pg_node_attr(query_jumble_ignore);
1119
- int location; /* token location, or -1 if unknown */
1120
- } RelabelType;
1121
-
1122
- /* ----------------
1123
- * CoerceViaIO
1124
- *
1125
- * CoerceViaIO represents a type coercion between two types whose textual
1126
- * representations are compatible, implemented by invoking the source type's
1127
- * typoutput function then the destination type's typinput function.
1128
- * ----------------
1129
- */
1130
-
1131
- typedef struct CoerceViaIO
1132
- {
1133
- Expr xpr;
1134
- Expr *arg; /* input expression */
1135
- Oid resulttype; /* output type of coercion */
1136
- /* output typmod is not stored, but is presumed -1 */
1137
- /* OID of collation, or InvalidOid if none */
1138
- Oid resultcollid pg_node_attr(query_jumble_ignore);
1139
- /* how to display this node */
1140
- CoercionForm coerceformat pg_node_attr(query_jumble_ignore);
1141
- int location; /* token location, or -1 if unknown */
1142
- } CoerceViaIO;
1143
-
1144
- /* ----------------
1145
- * ArrayCoerceExpr
1146
- *
1147
- * ArrayCoerceExpr represents a type coercion from one array type to another,
1148
- * which is implemented by applying the per-element coercion expression
1149
- * "elemexpr" to each element of the source array. Within elemexpr, the
1150
- * source element is represented by a CaseTestExpr node. Note that even if
1151
- * elemexpr is a no-op (that is, just CaseTestExpr + RelabelType), the
1152
- * coercion still requires some effort: we have to fix the element type OID
1153
- * stored in the array header.
1154
- * ----------------
1155
- */
1156
-
1157
- typedef struct ArrayCoerceExpr
1158
- {
1159
- Expr xpr;
1160
- Expr *arg; /* input expression (yields an array) */
1161
- Expr *elemexpr; /* expression representing per-element work */
1162
- Oid resulttype; /* output type of coercion (an array type) */
1163
- /* output typmod (also element typmod) */
1164
- int32 resulttypmod pg_node_attr(query_jumble_ignore);
1165
- /* OID of collation, or InvalidOid if none */
1166
- Oid resultcollid pg_node_attr(query_jumble_ignore);
1167
- /* how to display this node */
1168
- CoercionForm coerceformat pg_node_attr(query_jumble_ignore);
1169
- int location; /* token location, or -1 if unknown */
1170
- } ArrayCoerceExpr;
1171
-
1172
- /* ----------------
1173
- * ConvertRowtypeExpr
1174
- *
1175
- * ConvertRowtypeExpr represents a type coercion from one composite type
1176
- * to another, where the source type is guaranteed to contain all the columns
1177
- * needed for the destination type plus possibly others; the columns need not
1178
- * be in the same positions, but are matched up by name. This is primarily
1179
- * used to convert a whole-row value of an inheritance child table into a
1180
- * valid whole-row value of its parent table's rowtype. Both resulttype
1181
- * and the exposed type of "arg" must be named composite types (not domains).
1182
- * ----------------
1183
- */
1184
-
1185
- typedef struct ConvertRowtypeExpr
1186
- {
1187
- Expr xpr;
1188
- Expr *arg; /* input expression */
1189
- Oid resulttype; /* output type (always a composite type) */
1190
- /* Like RowExpr, we deliberately omit a typmod and collation here */
1191
- /* how to display this node */
1192
- CoercionForm convertformat pg_node_attr(query_jumble_ignore);
1193
- int location; /* token location, or -1 if unknown */
1194
- } ConvertRowtypeExpr;
1195
-
1196
- /*----------
1197
- * CollateExpr - COLLATE
1198
- *
1199
- * The planner replaces CollateExpr with RelabelType during expression
1200
- * preprocessing, so execution never sees a CollateExpr.
1201
- *----------
1202
- */
1203
- typedef struct CollateExpr
1204
- {
1205
- Expr xpr;
1206
- Expr *arg; /* input expression */
1207
- Oid collOid; /* collation's OID */
1208
- int location; /* token location, or -1 if unknown */
1209
- } CollateExpr;
1210
-
1211
- /*----------
1212
- * CaseExpr - a CASE expression
1213
- *
1214
- * We support two distinct forms of CASE expression:
1215
- * CASE WHEN boolexpr THEN expr [ WHEN boolexpr THEN expr ... ]
1216
- * CASE testexpr WHEN compexpr THEN expr [ WHEN compexpr THEN expr ... ]
1217
- * These are distinguishable by the "arg" field being NULL in the first case
1218
- * and the testexpr in the second case.
1219
- *
1220
- * In the raw grammar output for the second form, the condition expressions
1221
- * of the WHEN clauses are just the comparison values. Parse analysis
1222
- * converts these to valid boolean expressions of the form
1223
- * CaseTestExpr '=' compexpr
1224
- * where the CaseTestExpr node is a placeholder that emits the correct
1225
- * value at runtime. This structure is used so that the testexpr need be
1226
- * evaluated only once. Note that after parse analysis, the condition
1227
- * expressions always yield boolean.
1228
- *
1229
- * Note: we can test whether a CaseExpr has been through parse analysis
1230
- * yet by checking whether casetype is InvalidOid or not.
1231
- *----------
1232
- */
1233
- typedef struct CaseExpr
1234
- {
1235
- Expr xpr;
1236
- /* type of expression result */
1237
- Oid casetype pg_node_attr(query_jumble_ignore);
1238
- /* OID of collation, or InvalidOid if none */
1239
- Oid casecollid pg_node_attr(query_jumble_ignore);
1240
- Expr *arg; /* implicit equality comparison argument */
1241
- List *args; /* the arguments (list of WHEN clauses) */
1242
- Expr *defresult; /* the default result (ELSE clause) */
1243
- int location; /* token location, or -1 if unknown */
1244
- } CaseExpr;
1245
-
1246
- /*
1247
- * CaseWhen - one arm of a CASE expression
1248
- */
1249
- typedef struct CaseWhen
1250
- {
1251
- Expr xpr;
1252
- Expr *expr; /* condition expression */
1253
- Expr *result; /* substitution result */
1254
- int location; /* token location, or -1 if unknown */
1255
- } CaseWhen;
1256
-
1257
- /*
1258
- * Placeholder node for the test value to be processed by a CASE expression.
1259
- * This is effectively like a Param, but can be implemented more simply
1260
- * since we need only one replacement value at a time.
1261
- *
1262
- * We also abuse this node type for some other purposes, including:
1263
- * * Placeholder for the current array element value in ArrayCoerceExpr;
1264
- * see build_coercion_expression().
1265
- * * Nested FieldStore/SubscriptingRef assignment expressions in INSERT/UPDATE;
1266
- * see transformAssignmentIndirection().
1267
- * * Placeholder for intermediate results in some SQL/JSON expression nodes,
1268
- * such as JsonConstructorExpr.
1269
- *
1270
- * The uses in CaseExpr and ArrayCoerceExpr are safe only to the extent that
1271
- * there is not any other CaseExpr or ArrayCoerceExpr between the value source
1272
- * node and its child CaseTestExpr(s). This is true in the parse analysis
1273
- * output, but the planner's function-inlining logic has to be careful not to
1274
- * break it.
1275
- *
1276
- * The nested-assignment-expression case is safe because the only node types
1277
- * that can be above such CaseTestExprs are FieldStore and SubscriptingRef.
1278
- */
1279
- typedef struct CaseTestExpr
1280
- {
1281
- Expr xpr;
1282
- Oid typeId; /* type for substituted value */
1283
- /* typemod for substituted value */
1284
- int32 typeMod pg_node_attr(query_jumble_ignore);
1285
- /* collation for the substituted value */
1286
- Oid collation pg_node_attr(query_jumble_ignore);
1287
- } CaseTestExpr;
1288
-
1289
- /*
1290
- * ArrayExpr - an ARRAY[] expression
1291
- *
1292
- * Note: if multidims is false, the constituent expressions all yield the
1293
- * scalar type identified by element_typeid. If multidims is true, the
1294
- * constituent expressions all yield arrays of element_typeid (ie, the same
1295
- * type as array_typeid); at runtime we must check for compatible subscripts.
1296
- */
1297
- typedef struct ArrayExpr
1298
- {
1299
- Expr xpr;
1300
- /* type of expression result */
1301
- Oid array_typeid pg_node_attr(query_jumble_ignore);
1302
- /* OID of collation, or InvalidOid if none */
1303
- Oid array_collid pg_node_attr(query_jumble_ignore);
1304
- /* common type of array elements */
1305
- Oid element_typeid pg_node_attr(query_jumble_ignore);
1306
- /* the array elements or sub-arrays */
1307
- List *elements;
1308
- /* true if elements are sub-arrays */
1309
- bool multidims pg_node_attr(query_jumble_ignore);
1310
- /* token location, or -1 if unknown */
1311
- int location;
1312
- } ArrayExpr;
1313
-
1314
- /*
1315
- * RowExpr - a ROW() expression
1316
- *
1317
- * Note: the list of fields must have a one-for-one correspondence with
1318
- * physical fields of the associated rowtype, although it is okay for it
1319
- * to be shorter than the rowtype. That is, the N'th list element must
1320
- * match up with the N'th physical field. When the N'th physical field
1321
- * is a dropped column (attisdropped) then the N'th list element can just
1322
- * be a NULL constant. (This case can only occur for named composite types,
1323
- * not RECORD types, since those are built from the RowExpr itself rather
1324
- * than vice versa.) It is important not to assume that length(args) is
1325
- * the same as the number of columns logically present in the rowtype.
1326
- *
1327
- * colnames provides field names if the ROW() result is of type RECORD.
1328
- * Names *must* be provided if row_typeid is RECORDOID; but if it is a
1329
- * named composite type, colnames will be ignored in favor of using the
1330
- * type's cataloged field names, so colnames should be NIL. Like the
1331
- * args list, colnames is defined to be one-for-one with physical fields
1332
- * of the rowtype (although dropped columns shouldn't appear in the
1333
- * RECORD case, so this fine point is currently moot).
1334
- */
1335
- typedef struct RowExpr
1336
- {
1337
- Expr xpr;
1338
- List *args; /* the fields */
1339
-
1340
- /* RECORDOID or a composite type's ID */
1341
- Oid row_typeid pg_node_attr(query_jumble_ignore);
1342
-
1343
- /*
1344
- * row_typeid cannot be a domain over composite, only plain composite. To
1345
- * create a composite domain value, apply CoerceToDomain to the RowExpr.
1346
- *
1347
- * Note: we deliberately do NOT store a typmod. Although a typmod will be
1348
- * associated with specific RECORD types at runtime, it will differ for
1349
- * different backends, and so cannot safely be stored in stored
1350
- * parsetrees. We must assume typmod -1 for a RowExpr node.
1351
- *
1352
- * We don't need to store a collation either. The result type is
1353
- * necessarily composite, and composite types never have a collation.
1354
- */
1355
-
1356
- /* how to display this node */
1357
- CoercionForm row_format pg_node_attr(query_jumble_ignore);
1358
-
1359
- /* list of String, or NIL */
1360
- List *colnames pg_node_attr(query_jumble_ignore);
1361
-
1362
- int location; /* token location, or -1 if unknown */
1363
- } RowExpr;
1364
-
1365
- /*
1366
- * RowCompareExpr - row-wise comparison, such as (a, b) <= (1, 2)
1367
- *
1368
- * We support row comparison for any operator that can be determined to
1369
- * act like =, <>, <, <=, >, or >= (we determine this by looking for the
1370
- * operator in btree opfamilies). Note that the same operator name might
1371
- * map to a different operator for each pair of row elements, since the
1372
- * element datatypes can vary.
1373
- *
1374
- * A RowCompareExpr node is only generated for the < <= > >= cases;
1375
- * the = and <> cases are translated to simple AND or OR combinations
1376
- * of the pairwise comparisons. However, we include = and <> in the
1377
- * RowCompareType enum for the convenience of parser logic.
1378
- */
1379
- typedef enum RowCompareType
1380
- {
1381
- /* Values of this enum are chosen to match btree strategy numbers */
1382
- ROWCOMPARE_LT = 1, /* BTLessStrategyNumber */
1383
- ROWCOMPARE_LE = 2, /* BTLessEqualStrategyNumber */
1384
- ROWCOMPARE_EQ = 3, /* BTEqualStrategyNumber */
1385
- ROWCOMPARE_GE = 4, /* BTGreaterEqualStrategyNumber */
1386
- ROWCOMPARE_GT = 5, /* BTGreaterStrategyNumber */
1387
- ROWCOMPARE_NE = 6 /* no such btree strategy */
1388
- } RowCompareType;
1389
-
1390
- typedef struct RowCompareExpr
1391
- {
1392
- Expr xpr;
1393
-
1394
- /* LT LE GE or GT, never EQ or NE */
1395
- RowCompareType rctype;
1396
- /* OID list of pairwise comparison ops */
1397
- List *opnos pg_node_attr(query_jumble_ignore);
1398
- /* OID list of containing operator families */
1399
- List *opfamilies pg_node_attr(query_jumble_ignore);
1400
- /* OID list of collations for comparisons */
1401
- List *inputcollids pg_node_attr(query_jumble_ignore);
1402
- /* the left-hand input arguments */
1403
- List *largs;
1404
- /* the right-hand input arguments */
1405
- List *rargs;
1406
- } RowCompareExpr;
1407
-
1408
- /*
1409
- * CoalesceExpr - a COALESCE expression
1410
- */
1411
- typedef struct CoalesceExpr
1412
- {
1413
- Expr xpr;
1414
- /* type of expression result */
1415
- Oid coalescetype pg_node_attr(query_jumble_ignore);
1416
- /* OID of collation, or InvalidOid if none */
1417
- Oid coalescecollid pg_node_attr(query_jumble_ignore);
1418
- /* the arguments */
1419
- List *args;
1420
- /* token location, or -1 if unknown */
1421
- int location;
1422
- } CoalesceExpr;
1423
-
1424
- /*
1425
- * MinMaxExpr - a GREATEST or LEAST function
1426
- */
1427
- typedef enum MinMaxOp
1428
- {
1429
- IS_GREATEST,
1430
- IS_LEAST
1431
- } MinMaxOp;
1432
-
1433
- typedef struct MinMaxExpr
1434
- {
1435
- Expr xpr;
1436
- /* common type of arguments and result */
1437
- Oid minmaxtype pg_node_attr(query_jumble_ignore);
1438
- /* OID of collation of result */
1439
- Oid minmaxcollid pg_node_attr(query_jumble_ignore);
1440
- /* OID of collation that function should use */
1441
- Oid inputcollid pg_node_attr(query_jumble_ignore);
1442
- /* function to execute */
1443
- MinMaxOp op;
1444
- /* the arguments */
1445
- List *args;
1446
- /* token location, or -1 if unknown */
1447
- int location;
1448
- } MinMaxExpr;
1449
-
1450
- /*
1451
- * SQLValueFunction - parameterless functions with special grammar productions
1452
- *
1453
- * The SQL standard categorizes some of these as <datetime value function>
1454
- * and others as <general value specification>. We call 'em SQLValueFunctions
1455
- * for lack of a better term. We store type and typmod of the result so that
1456
- * some code doesn't need to know each function individually, and because
1457
- * we would need to store typmod anyway for some of the datetime functions.
1458
- * Note that currently, all variants return non-collating datatypes, so we do
1459
- * not need a collation field; also, all these functions are stable.
1460
- */
1461
- typedef enum SQLValueFunctionOp
1462
- {
1463
- SVFOP_CURRENT_DATE,
1464
- SVFOP_CURRENT_TIME,
1465
- SVFOP_CURRENT_TIME_N,
1466
- SVFOP_CURRENT_TIMESTAMP,
1467
- SVFOP_CURRENT_TIMESTAMP_N,
1468
- SVFOP_LOCALTIME,
1469
- SVFOP_LOCALTIME_N,
1470
- SVFOP_LOCALTIMESTAMP,
1471
- SVFOP_LOCALTIMESTAMP_N,
1472
- SVFOP_CURRENT_ROLE,
1473
- SVFOP_CURRENT_USER,
1474
- SVFOP_USER,
1475
- SVFOP_SESSION_USER,
1476
- SVFOP_CURRENT_CATALOG,
1477
- SVFOP_CURRENT_SCHEMA
1478
- } SQLValueFunctionOp;
1479
-
1480
- typedef struct SQLValueFunction
1481
- {
1482
- Expr xpr;
1483
- SQLValueFunctionOp op; /* which function this is */
1484
-
1485
- /*
1486
- * Result type/typmod. Type is fully determined by "op", so no need to
1487
- * include this Oid in the query jumbling.
1488
- */
1489
- Oid type pg_node_attr(query_jumble_ignore);
1490
- int32 typmod;
1491
- int location; /* token location, or -1 if unknown */
1492
- } SQLValueFunction;
1493
-
1494
- /*
1495
- * XmlExpr - various SQL/XML functions requiring special grammar productions
1496
- *
1497
- * 'name' carries the "NAME foo" argument (already XML-escaped).
1498
- * 'named_args' and 'arg_names' represent an xml_attribute list.
1499
- * 'args' carries all other arguments.
1500
- *
1501
- * Note: result type/typmod/collation are not stored, but can be deduced
1502
- * from the XmlExprOp. The type/typmod fields are just used for display
1503
- * purposes, and are NOT necessarily the true result type of the node.
1504
- */
1505
- typedef enum XmlExprOp
1506
- {
1507
- IS_XMLCONCAT, /* XMLCONCAT(args) */
1508
- IS_XMLELEMENT, /* XMLELEMENT(name, xml_attributes, args) */
1509
- IS_XMLFOREST, /* XMLFOREST(xml_attributes) */
1510
- IS_XMLPARSE, /* XMLPARSE(text, is_doc, preserve_ws) */
1511
- IS_XMLPI, /* XMLPI(name [, args]) */
1512
- IS_XMLROOT, /* XMLROOT(xml, version, standalone) */
1513
- IS_XMLSERIALIZE, /* XMLSERIALIZE(is_document, xmlval, indent) */
1514
- IS_DOCUMENT /* xmlval IS DOCUMENT */
1515
- } XmlExprOp;
1516
-
1517
- typedef enum XmlOptionType
1518
- {
1519
- XMLOPTION_DOCUMENT,
1520
- XMLOPTION_CONTENT
1521
- } XmlOptionType;
1522
-
1523
- typedef struct XmlExpr
1524
- {
1525
- Expr xpr;
1526
- /* xml function ID */
1527
- XmlExprOp op;
1528
- /* name in xml(NAME foo ...) syntaxes */
1529
- char *name pg_node_attr(query_jumble_ignore);
1530
- /* non-XML expressions for xml_attributes */
1531
- List *named_args;
1532
- /* parallel list of String values */
1533
- List *arg_names pg_node_attr(query_jumble_ignore);
1534
- /* list of expressions */
1535
- List *args;
1536
- /* DOCUMENT or CONTENT */
1537
- XmlOptionType xmloption pg_node_attr(query_jumble_ignore);
1538
- /* INDENT option for XMLSERIALIZE */
1539
- bool indent;
1540
- /* target type/typmod for XMLSERIALIZE */
1541
- Oid type pg_node_attr(query_jumble_ignore);
1542
- int32 typmod pg_node_attr(query_jumble_ignore);
1543
- /* token location, or -1 if unknown */
1544
- int location;
1545
- } XmlExpr;
1546
-
1547
- /*
1548
- * JsonEncoding -
1549
- * representation of JSON ENCODING clause
1550
- */
1551
- typedef enum JsonEncoding
1552
- {
1553
- JS_ENC_DEFAULT, /* unspecified */
1554
- JS_ENC_UTF8,
1555
- JS_ENC_UTF16,
1556
- JS_ENC_UTF32,
1557
- } JsonEncoding;
1558
-
1559
- /*
1560
- * JsonFormatType -
1561
- * enumeration of JSON formats used in JSON FORMAT clause
1562
- */
1563
- typedef enum JsonFormatType
1564
- {
1565
- JS_FORMAT_DEFAULT, /* unspecified */
1566
- JS_FORMAT_JSON, /* FORMAT JSON [ENCODING ...] */
1567
- JS_FORMAT_JSONB /* implicit internal format for RETURNING
1568
- * jsonb */
1569
- } JsonFormatType;
1570
-
1571
- /*
1572
- * JsonFormat -
1573
- * representation of JSON FORMAT clause
1574
- */
1575
- typedef struct JsonFormat
1576
- {
1577
- NodeTag type;
1578
- JsonFormatType format_type; /* format type */
1579
- JsonEncoding encoding; /* JSON encoding */
1580
- int location; /* token location, or -1 if unknown */
1581
- } JsonFormat;
1582
-
1583
- /*
1584
- * JsonReturning -
1585
- * transformed representation of JSON RETURNING clause
1586
- */
1587
- typedef struct JsonReturning
1588
- {
1589
- NodeTag type;
1590
- JsonFormat *format; /* output JSON format */
1591
- Oid typid; /* target type Oid */
1592
- int32 typmod; /* target type modifier */
1593
- } JsonReturning;
1594
-
1595
- /*
1596
- * JsonValueExpr -
1597
- * representation of JSON value expression (expr [FORMAT JsonFormat])
1598
- *
1599
- * The actual value is obtained by evaluating formatted_expr. raw_expr is
1600
- * only there for displaying the original user-written expression and is not
1601
- * evaluated by ExecInterpExpr() and eval_const_exprs_mutator().
1602
- */
1603
- typedef struct JsonValueExpr
1604
- {
1605
- NodeTag type;
1606
- Expr *raw_expr; /* raw expression */
1607
- Expr *formatted_expr; /* formatted expression */
1608
- JsonFormat *format; /* FORMAT clause, if specified */
1609
- } JsonValueExpr;
1610
-
1611
- typedef enum JsonConstructorType
1612
- {
1613
- JSCTOR_JSON_OBJECT = 1,
1614
- JSCTOR_JSON_ARRAY = 2,
1615
- JSCTOR_JSON_OBJECTAGG = 3,
1616
- JSCTOR_JSON_ARRAYAGG = 4
1617
- } JsonConstructorType;
1618
-
1619
- /*
1620
- * JsonConstructorExpr -
1621
- * wrapper over FuncExpr/Aggref/WindowFunc for SQL/JSON constructors
1622
- */
1623
- typedef struct JsonConstructorExpr
1624
- {
1625
- Expr xpr;
1626
- JsonConstructorType type; /* constructor type */
1627
- List *args;
1628
- Expr *func; /* underlying json[b]_xxx() function call */
1629
- Expr *coercion; /* coercion to RETURNING type */
1630
- JsonReturning *returning; /* RETURNING clause */
1631
- bool absent_on_null; /* ABSENT ON NULL? */
1632
- bool unique; /* WITH UNIQUE KEYS? (JSON_OBJECT[AGG] only) */
1633
- int location;
1634
- } JsonConstructorExpr;
1635
-
1636
- /*
1637
- * JsonValueType -
1638
- * representation of JSON item type in IS JSON predicate
1639
- */
1640
- typedef enum JsonValueType
1641
- {
1642
- JS_TYPE_ANY, /* IS JSON [VALUE] */
1643
- JS_TYPE_OBJECT, /* IS JSON OBJECT */
1644
- JS_TYPE_ARRAY, /* IS JSON ARRAY */
1645
- JS_TYPE_SCALAR /* IS JSON SCALAR */
1646
- } JsonValueType;
1647
-
1648
- /*
1649
- * JsonIsPredicate -
1650
- * representation of IS JSON predicate
1651
- */
1652
- typedef struct JsonIsPredicate
1653
- {
1654
- NodeTag type;
1655
- Node *expr; /* subject expression */
1656
- JsonFormat *format; /* FORMAT clause, if specified */
1657
- JsonValueType item_type; /* JSON item type */
1658
- bool unique_keys; /* check key uniqueness? */
1659
- int location; /* token location, or -1 if unknown */
1660
- } JsonIsPredicate;
1661
-
1662
- /* ----------------
1663
- * NullTest
1664
- *
1665
- * NullTest represents the operation of testing a value for NULLness.
1666
- * The appropriate test is performed and returned as a boolean Datum.
1667
- *
1668
- * When argisrow is false, this simply represents a test for the null value.
1669
- *
1670
- * When argisrow is true, the input expression must yield a rowtype, and
1671
- * the node implements "row IS [NOT] NULL" per the SQL standard. This
1672
- * includes checking individual fields for NULLness when the row datum
1673
- * itself isn't NULL.
1674
- *
1675
- * NOTE: the combination of a rowtype input and argisrow==false does NOT
1676
- * correspond to the SQL notation "row IS [NOT] NULL"; instead, this case
1677
- * represents the SQL notation "row IS [NOT] DISTINCT FROM NULL".
1678
- * ----------------
1679
- */
1680
-
1681
- typedef enum NullTestType
1682
- {
1683
- IS_NULL, IS_NOT_NULL
1684
- } NullTestType;
1685
-
1686
- typedef struct NullTest
1687
- {
1688
- Expr xpr;
1689
- Expr *arg; /* input expression */
1690
- NullTestType nulltesttype; /* IS NULL, IS NOT NULL */
1691
- /* T to perform field-by-field null checks */
1692
- bool argisrow pg_node_attr(query_jumble_ignore);
1693
- int location; /* token location, or -1 if unknown */
1694
- } NullTest;
1695
-
1696
- /*
1697
- * BooleanTest
1698
- *
1699
- * BooleanTest represents the operation of determining whether a boolean
1700
- * is TRUE, FALSE, or UNKNOWN (ie, NULL). All six meaningful combinations
1701
- * are supported. Note that a NULL input does *not* cause a NULL result.
1702
- * The appropriate test is performed and returned as a boolean Datum.
1703
- */
1704
-
1705
- typedef enum BoolTestType
1706
- {
1707
- IS_TRUE, IS_NOT_TRUE, IS_FALSE, IS_NOT_FALSE, IS_UNKNOWN, IS_NOT_UNKNOWN
1708
- } BoolTestType;
1709
-
1710
- typedef struct BooleanTest
1711
- {
1712
- Expr xpr;
1713
- Expr *arg; /* input expression */
1714
- BoolTestType booltesttype; /* test type */
1715
- int location; /* token location, or -1 if unknown */
1716
- } BooleanTest;
1717
-
1718
- /*
1719
- * CoerceToDomain
1720
- *
1721
- * CoerceToDomain represents the operation of coercing a value to a domain
1722
- * type. At runtime (and not before) the precise set of constraints to be
1723
- * checked will be determined. If the value passes, it is returned as the
1724
- * result; if not, an error is raised. Note that this is equivalent to
1725
- * RelabelType in the scenario where no constraints are applied.
1726
- */
1727
- typedef struct CoerceToDomain
1728
- {
1729
- Expr xpr;
1730
- Expr *arg; /* input expression */
1731
- Oid resulttype; /* domain type ID (result type) */
1732
- /* output typmod (currently always -1) */
1733
- int32 resulttypmod pg_node_attr(query_jumble_ignore);
1734
- /* OID of collation, or InvalidOid if none */
1735
- Oid resultcollid pg_node_attr(query_jumble_ignore);
1736
- /* how to display this node */
1737
- CoercionForm coercionformat pg_node_attr(query_jumble_ignore);
1738
- int location; /* token location, or -1 if unknown */
1739
- } CoerceToDomain;
1740
-
1741
- /*
1742
- * Placeholder node for the value to be processed by a domain's check
1743
- * constraint. This is effectively like a Param, but can be implemented more
1744
- * simply since we need only one replacement value at a time.
1745
- *
1746
- * Note: the typeId/typeMod/collation will be set from the domain's base type,
1747
- * not the domain itself. This is because we shouldn't consider the value
1748
- * to be a member of the domain if we haven't yet checked its constraints.
1749
- */
1750
- typedef struct CoerceToDomainValue
1751
- {
1752
- Expr xpr;
1753
- /* type for substituted value */
1754
- Oid typeId;
1755
- /* typemod for substituted value */
1756
- int32 typeMod pg_node_attr(query_jumble_ignore);
1757
- /* collation for the substituted value */
1758
- Oid collation pg_node_attr(query_jumble_ignore);
1759
- /* token location, or -1 if unknown */
1760
- int location;
1761
- } CoerceToDomainValue;
1762
-
1763
- /*
1764
- * Placeholder node for a DEFAULT marker in an INSERT or UPDATE command.
1765
- *
1766
- * This is not an executable expression: it must be replaced by the actual
1767
- * column default expression during rewriting. But it is convenient to
1768
- * treat it as an expression node during parsing and rewriting.
1769
- */
1770
- typedef struct SetToDefault
1771
- {
1772
- Expr xpr;
1773
- /* type for substituted value */
1774
- Oid typeId;
1775
- /* typemod for substituted value */
1776
- int32 typeMod pg_node_attr(query_jumble_ignore);
1777
- /* collation for the substituted value */
1778
- Oid collation pg_node_attr(query_jumble_ignore);
1779
- /* token location, or -1 if unknown */
1780
- int location;
1781
- } SetToDefault;
1782
-
1783
- /*
1784
- * Node representing [WHERE] CURRENT OF cursor_name
1785
- *
1786
- * CURRENT OF is a bit like a Var, in that it carries the rangetable index
1787
- * of the target relation being constrained; this aids placing the expression
1788
- * correctly during planning. We can assume however that its "levelsup" is
1789
- * always zero, due to the syntactic constraints on where it can appear.
1790
- * Also, cvarno will always be a true RT index, never INNER_VAR etc.
1791
- *
1792
- * The referenced cursor can be represented either as a hardwired string
1793
- * or as a reference to a run-time parameter of type REFCURSOR. The latter
1794
- * case is for the convenience of plpgsql.
1795
- */
1796
- typedef struct CurrentOfExpr
1797
- {
1798
- Expr xpr;
1799
- Index cvarno; /* RT index of target relation */
1800
- char *cursor_name; /* name of referenced cursor, or NULL */
1801
- int cursor_param; /* refcursor parameter number, or 0 */
1802
- } CurrentOfExpr;
1803
-
1804
- /*
1805
- * NextValueExpr - get next value from sequence
1806
- *
1807
- * This has the same effect as calling the nextval() function, but it does not
1808
- * check permissions on the sequence. This is used for identity columns,
1809
- * where the sequence is an implicit dependency without its own permissions.
1810
- */
1811
- typedef struct NextValueExpr
1812
- {
1813
- Expr xpr;
1814
- Oid seqid;
1815
- Oid typeId;
1816
- } NextValueExpr;
1817
-
1818
- /*
1819
- * InferenceElem - an element of a unique index inference specification
1820
- *
1821
- * This mostly matches the structure of IndexElems, but having a dedicated
1822
- * primnode allows for a clean separation between the use of index parameters
1823
- * by utility commands, and this node.
1824
- */
1825
- typedef struct InferenceElem
1826
- {
1827
- Expr xpr;
1828
- Node *expr; /* expression to infer from, or NULL */
1829
- Oid infercollid; /* OID of collation, or InvalidOid */
1830
- Oid inferopclass; /* OID of att opclass, or InvalidOid */
1831
- } InferenceElem;
1832
-
1833
- /*--------------------
1834
- * TargetEntry -
1835
- * a target entry (used in query target lists)
1836
- *
1837
- * Strictly speaking, a TargetEntry isn't an expression node (since it can't
1838
- * be evaluated by ExecEvalExpr). But we treat it as one anyway, since in
1839
- * very many places it's convenient to process a whole query targetlist as a
1840
- * single expression tree.
1841
- *
1842
- * In a SELECT's targetlist, resno should always be equal to the item's
1843
- * ordinal position (counting from 1). However, in an INSERT or UPDATE
1844
- * targetlist, resno represents the attribute number of the destination
1845
- * column for the item; so there may be missing or out-of-order resnos.
1846
- * It is even legal to have duplicated resnos; consider
1847
- * UPDATE table SET arraycol[1] = ..., arraycol[2] = ..., ...
1848
- * In an INSERT, the rewriter and planner will normalize the tlist by
1849
- * reordering it into physical column order and filling in default values
1850
- * for any columns not assigned values by the original query. In an UPDATE,
1851
- * after the rewriter merges multiple assignments for the same column, the
1852
- * planner extracts the target-column numbers into a separate "update_colnos"
1853
- * list, and then renumbers the tlist elements serially. Thus, tlist resnos
1854
- * match ordinal position in all tlists seen by the executor; but it is wrong
1855
- * to assume that before planning has happened.
1856
- *
1857
- * resname is required to represent the correct column name in non-resjunk
1858
- * entries of top-level SELECT targetlists, since it will be used as the
1859
- * column title sent to the frontend. In most other contexts it is only
1860
- * a debugging aid, and may be wrong or even NULL. (In particular, it may
1861
- * be wrong in a tlist from a stored rule, if the referenced column has been
1862
- * renamed by ALTER TABLE since the rule was made. Also, the planner tends
1863
- * to store NULL rather than look up a valid name for tlist entries in
1864
- * non-toplevel plan nodes.) In resjunk entries, resname should be either
1865
- * a specific system-generated name (such as "ctid") or NULL; anything else
1866
- * risks confusing ExecGetJunkAttribute!
1867
- *
1868
- * ressortgroupref is used in the representation of ORDER BY, GROUP BY, and
1869
- * DISTINCT items. Targetlist entries with ressortgroupref=0 are not
1870
- * sort/group items. If ressortgroupref>0, then this item is an ORDER BY,
1871
- * GROUP BY, and/or DISTINCT target value. No two entries in a targetlist
1872
- * may have the same nonzero ressortgroupref --- but there is no particular
1873
- * meaning to the nonzero values, except as tags. (For example, one must
1874
- * not assume that lower ressortgroupref means a more significant sort key.)
1875
- * The order of the associated SortGroupClause lists determine the semantics.
1876
- *
1877
- * resorigtbl/resorigcol identify the source of the column, if it is a
1878
- * simple reference to a column of a base table (or view). If it is not
1879
- * a simple reference, these fields are zeroes.
1880
- *
1881
- * If resjunk is true then the column is a working column (such as a sort key)
1882
- * that should be removed from the final output of the query. Resjunk columns
1883
- * must have resnos that cannot duplicate any regular column's resno. Also
1884
- * note that there are places that assume resjunk columns come after non-junk
1885
- * columns.
1886
- *--------------------
1887
- */
1888
- typedef struct TargetEntry
1889
- {
1890
- Expr xpr;
1891
- /* expression to evaluate */
1892
- Expr *expr;
1893
- /* attribute number (see notes above) */
1894
- AttrNumber resno;
1895
- /* name of the column (could be NULL) */
1896
- char *resname pg_node_attr(query_jumble_ignore);
1897
- /* nonzero if referenced by a sort/group clause */
1898
- Index ressortgroupref;
1899
- /* OID of column's source table */
1900
- Oid resorigtbl pg_node_attr(query_jumble_ignore);
1901
- /* column's number in source table */
1902
- AttrNumber resorigcol pg_node_attr(query_jumble_ignore);
1903
- /* set to true to eliminate the attribute from final target list */
1904
- bool resjunk pg_node_attr(query_jumble_ignore);
1905
- } TargetEntry;
1906
-
1907
-
1908
- /* ----------------------------------------------------------------
1909
- * node types for join trees
1910
- *
1911
- * The leaves of a join tree structure are RangeTblRef nodes. Above
1912
- * these, JoinExpr nodes can appear to denote a specific kind of join
1913
- * or qualified join. Also, FromExpr nodes can appear to denote an
1914
- * ordinary cross-product join ("FROM foo, bar, baz WHERE ...").
1915
- * FromExpr is like a JoinExpr of jointype JOIN_INNER, except that it
1916
- * may have any number of child nodes, not just two.
1917
- *
1918
- * NOTE: the top level of a Query's jointree is always a FromExpr.
1919
- * Even if the jointree contains no rels, there will be a FromExpr.
1920
- *
1921
- * NOTE: the qualification expressions present in JoinExpr nodes are
1922
- * *in addition to* the query's main WHERE clause, which appears as the
1923
- * qual of the top-level FromExpr. The reason for associating quals with
1924
- * specific nodes in the jointree is that the position of a qual is critical
1925
- * when outer joins are present. (If we enforce a qual too soon or too late,
1926
- * that may cause the outer join to produce the wrong set of NULL-extended
1927
- * rows.) If all joins are inner joins then all the qual positions are
1928
- * semantically interchangeable.
1929
- *
1930
- * NOTE: in the raw output of gram.y, a join tree contains RangeVar,
1931
- * RangeSubselect, and RangeFunction nodes, which are all replaced by
1932
- * RangeTblRef nodes during the parse analysis phase. Also, the top-level
1933
- * FromExpr is added during parse analysis; the grammar regards FROM and
1934
- * WHERE as separate.
1935
- * ----------------------------------------------------------------
1936
- */
1937
-
1938
- /*
1939
- * RangeTblRef - reference to an entry in the query's rangetable
1940
- *
1941
- * We could use direct pointers to the RT entries and skip having these
1942
- * nodes, but multiple pointers to the same node in a querytree cause
1943
- * lots of headaches, so it seems better to store an index into the RT.
1944
- */
1945
- typedef struct RangeTblRef
1946
- {
1947
- NodeTag type;
1948
- int rtindex;
1949
- } RangeTblRef;
1950
-
1951
- /*----------
1952
- * JoinExpr - for SQL JOIN expressions
1953
- *
1954
- * isNatural, usingClause, and quals are interdependent. The user can write
1955
- * only one of NATURAL, USING(), or ON() (this is enforced by the grammar).
1956
- * If he writes NATURAL then parse analysis generates the equivalent USING()
1957
- * list, and from that fills in "quals" with the right equality comparisons.
1958
- * If he writes USING() then "quals" is filled with equality comparisons.
1959
- * If he writes ON() then only "quals" is set. Note that NATURAL/USING
1960
- * are not equivalent to ON() since they also affect the output column list.
1961
- *
1962
- * alias is an Alias node representing the AS alias-clause attached to the
1963
- * join expression, or NULL if no clause. NB: presence or absence of the
1964
- * alias has a critical impact on semantics, because a join with an alias
1965
- * restricts visibility of the tables/columns inside it.
1966
- *
1967
- * join_using_alias is an Alias node representing the join correlation
1968
- * name that SQL:2016 and later allow to be attached to JOIN/USING.
1969
- * Its column alias list includes only the common column names from USING,
1970
- * and it does not restrict visibility of the join's input tables.
1971
- *
1972
- * During parse analysis, an RTE is created for the Join, and its index
1973
- * is filled into rtindex. This RTE is present mainly so that Vars can
1974
- * be created that refer to the outputs of the join. The planner sometimes
1975
- * generates JoinExprs internally; these can have rtindex = 0 if there are
1976
- * no join alias variables referencing such joins.
1977
- *----------
1978
- */
1979
- typedef struct JoinExpr
1980
- {
1981
- NodeTag type;
1982
- JoinType jointype; /* type of join */
1983
- bool isNatural; /* Natural join? Will need to shape table */
1984
- Node *larg; /* left subtree */
1985
- Node *rarg; /* right subtree */
1986
- /* USING clause, if any (list of String) */
1987
- List *usingClause pg_node_attr(query_jumble_ignore);
1988
- /* alias attached to USING clause, if any */
1989
- Alias *join_using_alias pg_node_attr(query_jumble_ignore);
1990
- /* qualifiers on join, if any */
1991
- Node *quals;
1992
- /* user-written alias clause, if any */
1993
- Alias *alias pg_node_attr(query_jumble_ignore);
1994
- /* RT index assigned for join, or 0 */
1995
- int rtindex;
1996
- } JoinExpr;
1997
-
1998
- /*----------
1999
- * FromExpr - represents a FROM ... WHERE ... construct
2000
- *
2001
- * This is both more flexible than a JoinExpr (it can have any number of
2002
- * children, including zero) and less so --- we don't need to deal with
2003
- * aliases and so on. The output column set is implicitly just the union
2004
- * of the outputs of the children.
2005
- *----------
2006
- */
2007
- typedef struct FromExpr
2008
- {
2009
- NodeTag type;
2010
- List *fromlist; /* List of join subtrees */
2011
- Node *quals; /* qualifiers on join, if any */
2012
- } FromExpr;
2013
-
2014
- /*----------
2015
- * OnConflictExpr - represents an ON CONFLICT DO ... expression
2016
- *
2017
- * The optimizer requires a list of inference elements, and optionally a WHERE
2018
- * clause to infer a unique index. The unique index (or, occasionally,
2019
- * indexes) inferred are used to arbitrate whether or not the alternative ON
2020
- * CONFLICT path is taken.
2021
- *----------
2022
- */
2023
- typedef struct OnConflictExpr
2024
- {
2025
- NodeTag type;
2026
- OnConflictAction action; /* DO NOTHING or UPDATE? */
2027
-
2028
- /* Arbiter */
2029
- List *arbiterElems; /* unique index arbiter list (of
2030
- * InferenceElem's) */
2031
- Node *arbiterWhere; /* unique index arbiter WHERE clause */
2032
- Oid constraint; /* pg_constraint OID for arbiter */
2033
-
2034
- /* ON CONFLICT UPDATE */
2035
- List *onConflictSet; /* List of ON CONFLICT SET TargetEntrys */
2036
- Node *onConflictWhere; /* qualifiers to restrict UPDATE to */
2037
- int exclRelIndex; /* RT index of 'excluded' relation */
2038
- List *exclRelTlist; /* tlist of the EXCLUDED pseudo relation */
2039
- } OnConflictExpr;
2040
-
2041
- #endif /* PRIMNODES_H */