pg_query 5.1.0 → 6.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (490) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +30 -0
  3. data/README.md +1 -1
  4. data/Rakefile +4 -4
  5. data/ext/pg_query/ext_symbols_freebsd.sym +1 -0
  6. data/ext/pg_query/ext_symbols_freebsd_with_ruby_abi_version.sym +2 -0
  7. data/ext/pg_query/ext_symbols_openbsd.sym +1 -0
  8. data/ext/pg_query/ext_symbols_openbsd_with_ruby_abi_version.sym +2 -0
  9. data/ext/pg_query/ext_symbols_with_ruby_abi_version.sym +2 -0
  10. data/ext/pg_query/extconf.rb +20 -6
  11. data/ext/pg_query/include/pg_query.h +4 -3
  12. data/ext/pg_query/include/pg_query_enum_defs.c +424 -154
  13. data/ext/pg_query/include/pg_query_fingerprint_conds.c +68 -4
  14. data/ext/pg_query/include/pg_query_fingerprint_defs.c +2952 -1845
  15. data/ext/pg_query/include/pg_query_outfuncs_conds.c +51 -3
  16. data/ext/pg_query/include/pg_query_outfuncs_defs.c +210 -23
  17. data/ext/pg_query/include/pg_query_readfuncs_conds.c +17 -1
  18. data/ext/pg_query/include/pg_query_readfuncs_defs.c +271 -52
  19. data/ext/pg_query/include/postgres/access/amapi.h +14 -3
  20. data/ext/pg_query/include/postgres/access/attmap.h +1 -1
  21. data/ext/pg_query/include/postgres/access/attnum.h +1 -1
  22. data/ext/pg_query/include/postgres/access/brin_internal.h +116 -0
  23. data/ext/pg_query/include/postgres/access/brin_tuple.h +112 -0
  24. data/ext/pg_query/include/postgres/access/clog.h +2 -3
  25. data/ext/pg_query/include/postgres/access/commit_ts.h +2 -3
  26. data/ext/pg_query/include/postgres/access/detoast.h +1 -1
  27. data/ext/pg_query/include/postgres/access/genam.h +17 -4
  28. data/ext/pg_query/include/postgres/access/gin.h +1 -1
  29. data/ext/pg_query/include/postgres/access/htup.h +1 -1
  30. data/ext/pg_query/include/postgres/access/htup_details.h +11 -11
  31. data/ext/pg_query/include/postgres/access/itup.h +3 -3
  32. data/ext/pg_query/include/postgres/access/parallel.h +1 -2
  33. data/ext/pg_query/include/postgres/access/printtup.h +1 -1
  34. data/ext/pg_query/include/postgres/access/relation.h +1 -1
  35. data/ext/pg_query/include/postgres/access/relscan.h +1 -1
  36. data/ext/pg_query/include/postgres/access/rmgrlist.h +1 -1
  37. data/ext/pg_query/include/postgres/access/sdir.h +1 -1
  38. data/ext/pg_query/include/postgres/access/skey.h +1 -1
  39. data/ext/pg_query/include/postgres/access/slru.h +218 -0
  40. data/ext/pg_query/include/postgres/access/stratnum.h +1 -1
  41. data/ext/pg_query/include/postgres/access/sysattr.h +1 -1
  42. data/ext/pg_query/include/postgres/access/table.h +1 -1
  43. data/ext/pg_query/include/postgres/access/tableam.h +35 -25
  44. data/ext/pg_query/include/postgres/access/tidstore.h +50 -0
  45. data/ext/pg_query/include/postgres/access/toast_compression.h +2 -2
  46. data/ext/pg_query/include/postgres/access/transam.h +50 -7
  47. data/ext/pg_query/include/postgres/access/tsmapi.h +1 -1
  48. data/ext/pg_query/include/postgres/access/tupconvert.h +1 -1
  49. data/ext/pg_query/include/postgres/access/tupdesc.h +5 -5
  50. data/ext/pg_query/include/postgres/access/tupmacs.h +1 -1
  51. data/ext/pg_query/include/postgres/access/twophase.h +2 -2
  52. data/ext/pg_query/include/postgres/access/xact.h +5 -5
  53. data/ext/pg_query/include/postgres/access/xlog.h +20 -12
  54. data/ext/pg_query/include/postgres/access/xlog_internal.h +4 -3
  55. data/ext/pg_query/include/postgres/access/xlogbackup.h +3 -1
  56. data/ext/pg_query/include/postgres/access/xlogdefs.h +5 -5
  57. data/ext/pg_query/include/postgres/access/xlogprefetcher.h +2 -2
  58. data/ext/pg_query/include/postgres/access/xlogreader.h +2 -2
  59. data/ext/pg_query/include/postgres/access/xlogrecord.h +3 -3
  60. data/ext/pg_query/include/postgres/access/xlogrecovery.h +4 -4
  61. data/ext/pg_query/include/postgres/archive/archive_module.h +9 -1
  62. data/ext/pg_query/include/postgres/c.h +32 -37
  63. data/ext/pg_query/include/postgres/catalog/catalog.h +3 -1
  64. data/ext/pg_query/include/postgres/catalog/catversion.h +2 -2
  65. data/ext/pg_query/include/postgres/catalog/dependency.h +17 -59
  66. data/ext/pg_query/include/postgres/catalog/genbki.h +12 -6
  67. data/ext/pg_query/include/postgres/catalog/index.h +22 -18
  68. data/ext/pg_query/include/postgres/catalog/indexing.h +1 -1
  69. data/ext/pg_query/include/postgres/catalog/namespace.h +18 -19
  70. data/ext/pg_query/include/postgres/catalog/objectaccess.h +2 -2
  71. data/ext/pg_query/include/postgres/catalog/objectaddress.h +5 -1
  72. data/ext/pg_query/include/postgres/catalog/pg_aggregate.h +4 -2
  73. data/ext/pg_query/include/postgres/catalog/pg_aggregate_d.h +1 -1
  74. data/ext/pg_query/include/postgres/catalog/pg_am.h +6 -3
  75. data/ext/pg_query/include/postgres/catalog/pg_am_d.h +1 -1
  76. data/ext/pg_query/include/postgres/catalog/pg_attribute.h +31 -14
  77. data/ext/pg_query/include/postgres/catalog/pg_attribute_d.h +3 -3
  78. data/ext/pg_query/include/postgres/catalog/pg_authid.h +6 -3
  79. data/ext/pg_query/include/postgres/catalog/pg_authid_d.h +2 -1
  80. data/ext/pg_query/include/postgres/catalog/pg_class.h +10 -5
  81. data/ext/pg_query/include/postgres/catalog/pg_class_d.h +4 -2
  82. data/ext/pg_query/include/postgres/catalog/pg_collation.h +11 -5
  83. data/ext/pg_query/include/postgres/catalog/pg_collation_d.h +5 -2
  84. data/ext/pg_query/include/postgres/catalog/pg_constraint.h +15 -10
  85. data/ext/pg_query/include/postgres/catalog/pg_constraint_d.h +2 -1
  86. data/ext/pg_query/include/postgres/catalog/pg_control.h +5 -3
  87. data/ext/pg_query/include/postgres/catalog/pg_conversion.h +8 -4
  88. data/ext/pg_query/include/postgres/catalog/pg_conversion_d.h +1 -1
  89. data/ext/pg_query/include/postgres/catalog/pg_database.h +9 -4
  90. data/ext/pg_query/include/postgres/catalog/pg_database_d.h +13 -12
  91. data/ext/pg_query/include/postgres/catalog/pg_depend.h +3 -3
  92. data/ext/pg_query/include/postgres/catalog/pg_depend_d.h +1 -1
  93. data/ext/pg_query/include/postgres/catalog/pg_event_trigger.h +6 -3
  94. data/ext/pg_query/include/postgres/catalog/pg_event_trigger_d.h +1 -1
  95. data/ext/pg_query/include/postgres/catalog/pg_index.h +5 -3
  96. data/ext/pg_query/include/postgres/catalog/pg_index_d.h +1 -1
  97. data/ext/pg_query/include/postgres/catalog/pg_language.h +6 -3
  98. data/ext/pg_query/include/postgres/catalog/pg_language_d.h +1 -1
  99. data/ext/pg_query/include/postgres/catalog/pg_namespace.h +6 -3
  100. data/ext/pg_query/include/postgres/catalog/pg_namespace_d.h +1 -1
  101. data/ext/pg_query/include/postgres/catalog/pg_opclass.h +6 -3
  102. data/ext/pg_query/include/postgres/catalog/pg_opclass_d.h +1 -1
  103. data/ext/pg_query/include/postgres/catalog/pg_operator.h +20 -3
  104. data/ext/pg_query/include/postgres/catalog/pg_operator_d.h +1 -1
  105. data/ext/pg_query/include/postgres/catalog/pg_opfamily.h +6 -3
  106. data/ext/pg_query/include/postgres/catalog/pg_opfamily_d.h +1 -1
  107. data/ext/pg_query/include/postgres/catalog/pg_partitioned_table.h +4 -2
  108. data/ext/pg_query/include/postgres/catalog/pg_partitioned_table_d.h +1 -1
  109. data/ext/pg_query/include/postgres/catalog/pg_proc.h +6 -3
  110. data/ext/pg_query/include/postgres/catalog/pg_proc_d.h +1 -1
  111. data/ext/pg_query/include/postgres/catalog/pg_publication.h +6 -3
  112. data/ext/pg_query/include/postgres/catalog/pg_publication_d.h +1 -1
  113. data/ext/pg_query/include/postgres/catalog/pg_replication_origin.h +6 -3
  114. data/ext/pg_query/include/postgres/catalog/pg_replication_origin_d.h +1 -1
  115. data/ext/pg_query/include/postgres/catalog/pg_statistic.h +10 -4
  116. data/ext/pg_query/include/postgres/catalog/pg_statistic_d.h +7 -3
  117. data/ext/pg_query/include/postgres/catalog/pg_statistic_ext.h +10 -7
  118. data/ext/pg_query/include/postgres/catalog/pg_statistic_ext_d.h +3 -3
  119. data/ext/pg_query/include/postgres/catalog/pg_transform.h +6 -3
  120. data/ext/pg_query/include/postgres/catalog/pg_transform_d.h +1 -1
  121. data/ext/pg_query/include/postgres/catalog/pg_trigger.h +4 -4
  122. data/ext/pg_query/include/postgres/catalog/pg_trigger_d.h +1 -1
  123. data/ext/pg_query/include/postgres/catalog/pg_ts_config.h +6 -3
  124. data/ext/pg_query/include/postgres/catalog/pg_ts_config_d.h +1 -1
  125. data/ext/pg_query/include/postgres/catalog/pg_ts_dict.h +6 -3
  126. data/ext/pg_query/include/postgres/catalog/pg_ts_dict_d.h +1 -1
  127. data/ext/pg_query/include/postgres/catalog/pg_ts_parser.h +6 -3
  128. data/ext/pg_query/include/postgres/catalog/pg_ts_parser_d.h +1 -1
  129. data/ext/pg_query/include/postgres/catalog/pg_ts_template.h +6 -3
  130. data/ext/pg_query/include/postgres/catalog/pg_ts_template_d.h +1 -1
  131. data/ext/pg_query/include/postgres/catalog/pg_type.h +6 -3
  132. data/ext/pg_query/include/postgres/catalog/pg_type_d.h +1 -1
  133. data/ext/pg_query/include/postgres/catalog/storage.h +1 -1
  134. data/ext/pg_query/include/postgres/catalog/syscache_ids.h +104 -0
  135. data/ext/pg_query/include/postgres/commands/async.h +2 -6
  136. data/ext/pg_query/include/postgres/commands/dbcommands.h +1 -1
  137. data/ext/pg_query/include/postgres/commands/defrem.h +6 -6
  138. data/ext/pg_query/include/postgres/commands/event_trigger.h +11 -2
  139. data/ext/pg_query/include/postgres/commands/explain.h +19 -3
  140. data/ext/pg_query/include/postgres/commands/prepare.h +1 -1
  141. data/ext/pg_query/include/postgres/commands/tablespace.h +1 -1
  142. data/ext/pg_query/include/postgres/commands/trigger.h +1 -1
  143. data/ext/pg_query/include/postgres/commands/vacuum.h +28 -26
  144. data/ext/pg_query/include/postgres/common/cryptohash.h +2 -2
  145. data/ext/pg_query/include/postgres/common/file_perm.h +1 -1
  146. data/ext/pg_query/include/postgres/common/file_utils.h +65 -0
  147. data/ext/pg_query/include/postgres/common/hashfn.h +16 -1
  148. data/ext/pg_query/include/postgres/common/hashfn_unstable.h +407 -0
  149. data/ext/pg_query/include/postgres/common/int.h +79 -4
  150. data/ext/pg_query/include/postgres/common/keywords.h +1 -1
  151. data/ext/pg_query/include/postgres/common/kwlookup.h +1 -1
  152. data/ext/pg_query/include/postgres/common/pg_prng.h +2 -1
  153. data/ext/pg_query/include/postgres/common/relpath.h +4 -4
  154. data/ext/pg_query/include/postgres/common/scram-common.h +1 -1
  155. data/ext/pg_query/include/postgres/common/sha2.h +1 -1
  156. data/ext/pg_query/include/postgres/common/string.h +1 -1
  157. data/ext/pg_query/include/postgres/common/unicode_east_asian_fw_table.h +2 -3
  158. data/ext/pg_query/include/postgres/copyfuncs.funcs.c +278 -30
  159. data/ext/pg_query/include/postgres/copyfuncs.switch.c +55 -4
  160. data/ext/pg_query/include/postgres/datatype/timestamp.h +29 -3
  161. data/ext/pg_query/include/postgres/equalfuncs.funcs.c +239 -26
  162. data/ext/pg_query/include/postgres/equalfuncs.switch.c +55 -4
  163. data/ext/pg_query/include/postgres/executor/execdesc.h +2 -2
  164. data/ext/pg_query/include/postgres/executor/executor.h +6 -5
  165. data/ext/pg_query/include/postgres/executor/functions.h +2 -1
  166. data/ext/pg_query/include/postgres/executor/instrument.h +5 -3
  167. data/ext/pg_query/include/postgres/executor/spi.h +2 -8
  168. data/ext/pg_query/include/postgres/executor/tablefunc.h +1 -1
  169. data/ext/pg_query/include/postgres/executor/tuptable.h +31 -2
  170. data/ext/pg_query/include/postgres/fmgr.h +2 -2
  171. data/ext/pg_query/include/postgres/foreign/fdwapi.h +1 -1
  172. data/ext/pg_query/include/postgres/funcapi.h +2 -2
  173. data/ext/pg_query/include/postgres/gram.h +871 -830
  174. data/ext/pg_query/include/postgres/gramparse.h +1 -1
  175. data/ext/pg_query/include/postgres/jit/jit.h +4 -3
  176. data/ext/pg_query/include/postgres/kwlist_d.h +511 -466
  177. data/ext/pg_query/include/postgres/lib/dshash.h +25 -10
  178. data/ext/pg_query/include/postgres/lib/ilist.h +1 -1
  179. data/ext/pg_query/include/postgres/lib/pairingheap.h +1 -1
  180. data/ext/pg_query/include/postgres/lib/simplehash.h +40 -18
  181. data/ext/pg_query/include/postgres/lib/sort_template.h +14 -1
  182. data/ext/pg_query/include/postgres/lib/stringinfo.h +93 -11
  183. data/ext/pg_query/include/postgres/libpq/auth.h +1 -1
  184. data/ext/pg_query/include/postgres/libpq/crypt.h +2 -2
  185. data/ext/pg_query/include/postgres/libpq/hba.h +4 -4
  186. data/ext/pg_query/include/postgres/libpq/libpq-be.h +35 -28
  187. data/ext/pg_query/include/postgres/libpq/libpq.h +6 -7
  188. data/ext/pg_query/include/postgres/libpq/pqcomm.h +26 -20
  189. data/ext/pg_query/include/postgres/libpq/pqformat.h +2 -3
  190. data/ext/pg_query/include/postgres/libpq/pqsignal.h +1 -1
  191. data/ext/pg_query/include/postgres/libpq/protocol.h +89 -0
  192. data/ext/pg_query/include/postgres/libpq/sasl.h +1 -1
  193. data/ext/pg_query/include/postgres/libpq/scram.h +1 -1
  194. data/ext/pg_query/include/postgres/mb/pg_wchar.h +103 -82
  195. data/ext/pg_query/include/postgres/mb/stringinfo_mb.h +1 -1
  196. data/ext/pg_query/include/postgres/miscadmin.h +72 -52
  197. data/ext/pg_query/include/postgres/nodes/bitmapset.h +17 -3
  198. data/ext/pg_query/include/postgres/nodes/execnodes.h +112 -25
  199. data/ext/pg_query/include/postgres/nodes/extensible.h +1 -1
  200. data/ext/pg_query/include/postgres/nodes/lockoptions.h +4 -4
  201. data/ext/pg_query/include/postgres/nodes/makefuncs.h +8 -2
  202. data/ext/pg_query/include/postgres/nodes/memnodes.h +43 -4
  203. data/ext/pg_query/include/postgres/nodes/miscnodes.h +1 -1
  204. data/ext/pg_query/include/postgres/nodes/nodeFuncs.h +1 -1
  205. data/ext/pg_query/include/postgres/nodes/nodes.h +30 -41
  206. data/ext/pg_query/include/postgres/nodes/nodetags.h +464 -444
  207. data/ext/pg_query/include/postgres/nodes/params.h +1 -1
  208. data/ext/pg_query/include/postgres/nodes/parsenodes.h +358 -175
  209. data/ext/pg_query/include/postgres/nodes/pathnodes.h +64 -10
  210. data/ext/pg_query/include/postgres/nodes/pg_list.h +62 -11
  211. data/ext/pg_query/include/postgres/nodes/plannodes.h +11 -10
  212. data/ext/pg_query/include/postgres/nodes/primnodes.h +352 -54
  213. data/ext/pg_query/include/postgres/nodes/print.h +1 -1
  214. data/ext/pg_query/include/postgres/nodes/queryjumble.h +2 -2
  215. data/ext/pg_query/include/postgres/nodes/replnodes.h +23 -2
  216. data/ext/pg_query/include/postgres/nodes/supportnodes.h +1 -1
  217. data/ext/pg_query/include/postgres/nodes/tidbitmap.h +1 -1
  218. data/ext/pg_query/include/postgres/nodes/value.h +1 -1
  219. data/ext/pg_query/include/postgres/optimizer/cost.h +5 -4
  220. data/ext/pg_query/include/postgres/optimizer/geqo.h +1 -1
  221. data/ext/pg_query/include/postgres/optimizer/geqo_gene.h +1 -1
  222. data/ext/pg_query/include/postgres/optimizer/optimizer.h +5 -2
  223. data/ext/pg_query/include/postgres/optimizer/paths.h +13 -8
  224. data/ext/pg_query/include/postgres/optimizer/planmain.h +7 -1
  225. data/ext/pg_query/include/postgres/parser/analyze.h +3 -1
  226. data/ext/pg_query/include/postgres/parser/kwlist.h +22 -2
  227. data/ext/pg_query/include/postgres/parser/parse_agg.h +1 -1
  228. data/ext/pg_query/include/postgres/parser/parse_coerce.h +5 -2
  229. data/ext/pg_query/include/postgres/parser/parse_expr.h +1 -1
  230. data/ext/pg_query/include/postgres/parser/parse_func.h +2 -2
  231. data/ext/pg_query/include/postgres/parser/parse_node.h +3 -2
  232. data/ext/pg_query/include/postgres/parser/parse_oper.h +4 -1
  233. data/ext/pg_query/include/postgres/parser/parse_relation.h +1 -1
  234. data/ext/pg_query/include/postgres/parser/parse_type.h +2 -2
  235. data/ext/pg_query/include/postgres/parser/parser.h +3 -3
  236. data/ext/pg_query/include/postgres/parser/parsetree.h +1 -1
  237. data/ext/pg_query/include/postgres/parser/scanner.h +1 -1
  238. data/ext/pg_query/include/postgres/parser/scansup.h +1 -1
  239. data/ext/pg_query/include/postgres/partitioning/partdefs.h +1 -1
  240. data/ext/pg_query/include/postgres/pg_config.h +53 -45
  241. data/ext/pg_query/include/postgres/pg_config_manual.h +21 -8
  242. data/ext/pg_query/include/postgres/pg_getopt.h +1 -1
  243. data/ext/pg_query/include/postgres/pg_trace.h +1 -1
  244. data/ext/pg_query/include/postgres/pgstat.h +13 -11
  245. data/ext/pg_query/include/postgres/pgtime.h +1 -1
  246. data/ext/pg_query/include/postgres/pl_reserved_kwlist.h +1 -1
  247. data/ext/pg_query/include/postgres/pl_reserved_kwlist_d.h +1 -1
  248. data/ext/pg_query/include/postgres/pl_unreserved_kwlist.h +1 -1
  249. data/ext/pg_query/include/postgres/pl_unreserved_kwlist_d.h +1 -1
  250. data/ext/pg_query/include/postgres/plerrcodes.h +4 -4
  251. data/ext/pg_query/include/postgres/plpgsql.h +15 -13
  252. data/ext/pg_query/include/postgres/port/atomics/arch-arm.h +1 -1
  253. data/ext/pg_query/include/postgres/port/atomics/arch-hppa.h +1 -1
  254. data/ext/pg_query/include/postgres/port/atomics/arch-ppc.h +3 -1
  255. data/ext/pg_query/include/postgres/port/atomics/arch-x86.h +3 -1
  256. data/ext/pg_query/include/postgres/port/atomics/fallback.h +1 -1
  257. data/ext/pg_query/include/postgres/port/atomics/generic-gcc.h +38 -1
  258. data/ext/pg_query/include/postgres/port/atomics/generic-msvc.h +19 -1
  259. data/ext/pg_query/include/postgres/port/atomics/generic-sunpro.h +16 -1
  260. data/ext/pg_query/include/postgres/port/atomics/generic.h +38 -2
  261. data/ext/pg_query/include/postgres/port/atomics.h +93 -6
  262. data/ext/pg_query/include/postgres/port/pg_bitutils.h +91 -9
  263. data/ext/pg_query/include/postgres/port/pg_bswap.h +1 -1
  264. data/ext/pg_query/include/postgres/port/pg_crc32c.h +10 -1
  265. data/ext/pg_query/include/postgres/port/pg_iovec.h +117 -0
  266. data/ext/pg_query/include/postgres/port/simd.h +48 -1
  267. data/ext/pg_query/include/postgres/port/win32/sys/socket.h +8 -0
  268. data/ext/pg_query/include/postgres/port/win32_port.h +1 -13
  269. data/ext/pg_query/include/postgres/port.h +39 -4
  270. data/ext/pg_query/include/postgres/portability/instr_time.h +1 -1
  271. data/ext/pg_query/include/postgres/postgres.h +1 -1
  272. data/ext/pg_query/include/postgres/postmaster/autovacuum.h +5 -16
  273. data/ext/pg_query/include/postgres/postmaster/bgworker.h +8 -6
  274. data/ext/pg_query/include/postgres/postmaster/bgworker_internals.h +3 -7
  275. data/ext/pg_query/include/postgres/postmaster/bgwriter.h +3 -3
  276. data/ext/pg_query/include/postgres/postmaster/interrupt.h +1 -1
  277. data/ext/pg_query/include/postgres/postmaster/pgarch.h +2 -2
  278. data/ext/pg_query/include/postgres/postmaster/postmaster.h +25 -5
  279. data/ext/pg_query/include/postgres/postmaster/startup.h +2 -2
  280. data/ext/pg_query/include/postgres/postmaster/syslogger.h +2 -4
  281. data/ext/pg_query/include/postgres/postmaster/walsummarizer.h +35 -0
  282. data/ext/pg_query/include/postgres/postmaster/walwriter.h +2 -2
  283. data/ext/pg_query/include/postgres/regex/regex.h +92 -9
  284. data/ext/pg_query/include/postgres/replication/logicallauncher.h +1 -1
  285. data/ext/pg_query/include/postgres/replication/logicalproto.h +2 -2
  286. data/ext/pg_query/include/postgres/replication/logicalworker.h +2 -1
  287. data/ext/pg_query/include/postgres/replication/origin.h +1 -1
  288. data/ext/pg_query/include/postgres/replication/reorderbuffer.h +27 -46
  289. data/ext/pg_query/include/postgres/replication/slot.h +45 -5
  290. data/ext/pg_query/include/postgres/replication/slotsync.h +38 -0
  291. data/ext/pg_query/include/postgres/replication/syncrep.h +1 -1
  292. data/ext/pg_query/include/postgres/replication/walreceiver.h +37 -11
  293. data/ext/pg_query/include/postgres/replication/walsender.h +5 -3
  294. data/ext/pg_query/include/postgres/rewrite/prs2lock.h +1 -1
  295. data/ext/pg_query/include/postgres/rewrite/rewriteHandler.h +7 -1
  296. data/ext/pg_query/include/postgres/rewrite/rewriteManip.h +2 -2
  297. data/ext/pg_query/include/postgres/rewrite/rewriteSupport.h +1 -1
  298. data/ext/pg_query/include/postgres/storage/block.h +1 -1
  299. data/ext/pg_query/include/postgres/storage/buf.h +1 -1
  300. data/ext/pg_query/include/postgres/storage/bufmgr.h +59 -41
  301. data/ext/pg_query/include/postgres/storage/bufpage.h +1 -1
  302. data/ext/pg_query/include/postgres/storage/condition_variable.h +1 -1
  303. data/ext/pg_query/include/postgres/storage/dsm.h +1 -1
  304. data/ext/pg_query/include/postgres/storage/dsm_impl.h +2 -2
  305. data/ext/pg_query/include/postgres/storage/fd.h +30 -13
  306. data/ext/pg_query/include/postgres/storage/fileset.h +1 -1
  307. data/ext/pg_query/include/postgres/storage/ipc.h +4 -1
  308. data/ext/pg_query/include/postgres/storage/item.h +1 -1
  309. data/ext/pg_query/include/postgres/storage/itemid.h +1 -1
  310. data/ext/pg_query/include/postgres/storage/itemptr.h +1 -1
  311. data/ext/pg_query/include/postgres/storage/large_object.h +1 -1
  312. data/ext/pg_query/include/postgres/storage/latch.h +4 -2
  313. data/ext/pg_query/include/postgres/storage/lmgr.h +8 -2
  314. data/ext/pg_query/include/postgres/storage/lock.h +19 -19
  315. data/ext/pg_query/include/postgres/storage/lockdefs.h +3 -1
  316. data/ext/pg_query/include/postgres/storage/lwlock.h +17 -9
  317. data/ext/pg_query/include/postgres/storage/lwlocknames.h +7 -10
  318. data/ext/pg_query/include/postgres/storage/off.h +1 -1
  319. data/ext/pg_query/include/postgres/storage/pg_sema.h +1 -1
  320. data/ext/pg_query/include/postgres/storage/pg_shmem.h +5 -4
  321. data/ext/pg_query/include/postgres/storage/pmsignal.h +2 -2
  322. data/ext/pg_query/include/postgres/storage/predicate.h +1 -5
  323. data/ext/pg_query/include/postgres/storage/proc.h +48 -26
  324. data/ext/pg_query/include/postgres/storage/procarray.h +5 -1
  325. data/ext/pg_query/include/postgres/storage/proclist_types.h +11 -9
  326. data/ext/pg_query/include/postgres/storage/procnumber.h +43 -0
  327. data/ext/pg_query/include/postgres/storage/procsignal.h +8 -6
  328. data/ext/pg_query/include/postgres/storage/read_stream.h +65 -0
  329. data/ext/pg_query/include/postgres/storage/relfilelocator.h +16 -15
  330. data/ext/pg_query/include/postgres/storage/s_lock.h +7 -27
  331. data/ext/pg_query/include/postgres/storage/sharedfileset.h +1 -1
  332. data/ext/pg_query/include/postgres/storage/shm_mq.h +2 -2
  333. data/ext/pg_query/include/postgres/storage/shm_toc.h +1 -1
  334. data/ext/pg_query/include/postgres/storage/shmem.h +1 -1
  335. data/ext/pg_query/include/postgres/storage/sinval.h +3 -3
  336. data/ext/pg_query/include/postgres/storage/smgr.h +46 -29
  337. data/ext/pg_query/include/postgres/storage/spin.h +1 -1
  338. data/ext/pg_query/include/postgres/storage/standby.h +13 -3
  339. data/ext/pg_query/include/postgres/storage/standbydefs.h +2 -2
  340. data/ext/pg_query/include/postgres/storage/sync.h +4 -4
  341. data/ext/pg_query/include/postgres/tcop/cmdtag.h +1 -2
  342. data/ext/pg_query/include/postgres/tcop/cmdtaglist.h +3 -2
  343. data/ext/pg_query/include/postgres/tcop/deparse_utility.h +2 -2
  344. data/ext/pg_query/include/postgres/tcop/dest.h +3 -2
  345. data/ext/pg_query/include/postgres/tcop/fastpath.h +1 -1
  346. data/ext/pg_query/include/postgres/tcop/pquery.h +1 -1
  347. data/ext/pg_query/include/postgres/tcop/tcopprot.h +9 -5
  348. data/ext/pg_query/include/postgres/tcop/utility.h +2 -2
  349. data/ext/pg_query/include/postgres/tsearch/ts_cache.h +1 -1
  350. data/ext/pg_query/include/postgres/utils/acl.h +19 -7
  351. data/ext/pg_query/include/postgres/utils/aclchk_internal.h +1 -1
  352. data/ext/pg_query/include/postgres/utils/array.h +1 -2
  353. data/ext/pg_query/include/postgres/utils/ascii.h +84 -0
  354. data/ext/pg_query/include/postgres/utils/backend_progress.h +3 -2
  355. data/ext/pg_query/include/postgres/utils/backend_status.h +8 -10
  356. data/ext/pg_query/include/postgres/utils/builtins.h +4 -1
  357. data/ext/pg_query/include/postgres/utils/bytea.h +2 -2
  358. data/ext/pg_query/include/postgres/utils/catcache.h +6 -6
  359. data/ext/pg_query/include/postgres/utils/date.h +1 -1
  360. data/ext/pg_query/include/postgres/utils/datetime.h +4 -1
  361. data/ext/pg_query/include/postgres/utils/datum.h +1 -1
  362. data/ext/pg_query/include/postgres/utils/dsa.h +44 -5
  363. data/ext/pg_query/include/postgres/utils/elog.h +3 -8
  364. data/ext/pg_query/include/postgres/utils/errcodes.h +1 -3
  365. data/ext/pg_query/include/postgres/utils/expandeddatum.h +1 -1
  366. data/ext/pg_query/include/postgres/utils/expandedrecord.h +1 -1
  367. data/ext/pg_query/include/postgres/utils/float.h +1 -1
  368. data/ext/pg_query/include/postgres/utils/fmgroids.h +49 -16
  369. data/ext/pg_query/include/postgres/utils/fmgrprotos.h +47 -14
  370. data/ext/pg_query/include/postgres/utils/fmgrtab.h +1 -1
  371. data/ext/pg_query/include/postgres/utils/guc.h +20 -6
  372. data/ext/pg_query/include/postgres/utils/guc_hooks.h +23 -2
  373. data/ext/pg_query/include/postgres/utils/guc_tables.h +6 -5
  374. data/ext/pg_query/include/postgres/utils/hsearch.h +2 -2
  375. data/ext/pg_query/include/postgres/utils/injection_point.h +44 -0
  376. data/ext/pg_query/include/postgres/utils/inval.h +1 -1
  377. data/ext/pg_query/include/postgres/utils/logtape.h +5 -5
  378. data/ext/pg_query/include/postgres/utils/lsyscache.h +6 -3
  379. data/ext/pg_query/include/postgres/utils/memdebug.h +1 -1
  380. data/ext/pg_query/include/postgres/utils/memutils.h +12 -5
  381. data/ext/pg_query/include/postgres/utils/memutils_internal.h +53 -13
  382. data/ext/pg_query/include/postgres/utils/memutils_memorychunk.h +25 -9
  383. data/ext/pg_query/include/postgres/utils/numeric.h +6 -1
  384. data/ext/pg_query/include/postgres/utils/palloc.h +1 -15
  385. data/ext/pg_query/include/postgres/utils/partcache.h +1 -1
  386. data/ext/pg_query/include/postgres/utils/pg_locale.h +8 -7
  387. data/ext/pg_query/include/postgres/utils/pgstat_internal.h +30 -17
  388. data/ext/pg_query/include/postgres/utils/plancache.h +5 -3
  389. data/ext/pg_query/include/postgres/utils/portal.h +10 -10
  390. data/ext/pg_query/include/postgres/utils/queryenvironment.h +2 -2
  391. data/ext/pg_query/include/postgres/utils/regproc.h +1 -1
  392. data/ext/pg_query/include/postgres/utils/rel.h +14 -15
  393. data/ext/pg_query/include/postgres/utils/relcache.h +2 -5
  394. data/ext/pg_query/include/postgres/utils/reltrigger.h +1 -1
  395. data/ext/pg_query/include/postgres/utils/resowner.h +90 -9
  396. data/ext/pg_query/include/postgres/utils/ruleutils.h +1 -1
  397. data/ext/pg_query/include/postgres/utils/sharedtuplestore.h +1 -1
  398. data/ext/pg_query/include/postgres/utils/snapmgr.h +1 -52
  399. data/ext/pg_query/include/postgres/utils/snapshot.h +2 -2
  400. data/ext/pg_query/include/postgres/utils/sortsupport.h +1 -1
  401. data/ext/pg_query/include/postgres/utils/syscache.h +7 -98
  402. data/ext/pg_query/include/postgres/utils/timeout.h +3 -2
  403. data/ext/pg_query/include/postgres/utils/timestamp.h +1 -1
  404. data/ext/pg_query/include/postgres/utils/tuplesort.h +36 -9
  405. data/ext/pg_query/include/postgres/utils/tuplestore.h +2 -5
  406. data/ext/pg_query/include/postgres/utils/typcache.h +2 -1
  407. data/ext/pg_query/include/postgres/utils/varlena.h +1 -1
  408. data/ext/pg_query/include/postgres/utils/wait_event.h +28 -214
  409. data/ext/pg_query/include/postgres/utils/wait_event_types.h +218 -0
  410. data/ext/pg_query/include/postgres/utils/xml.h +4 -4
  411. data/ext/pg_query/include/postgres/varatt.h +1 -1
  412. data/ext/pg_query/include/protobuf/pg_query.pb-c.h +1546 -792
  413. data/ext/pg_query/include/protobuf/pg_query.pb.h +58365 -46595
  414. data/ext/pg_query/pg_query.pb-c.c +6598 -3739
  415. data/ext/pg_query/pg_query_normalize.c +42 -1
  416. data/ext/pg_query/pg_query_outfuncs_json.c +3 -1
  417. data/ext/pg_query/pg_query_parse_plpgsql.c +12 -13
  418. data/ext/pg_query/pg_query_readfuncs_protobuf.c +2 -2
  419. data/ext/pg_query/pg_query_scan.c +1 -1
  420. data/ext/pg_query/postgres_deparse.c +601 -172
  421. data/ext/pg_query/src_backend_catalog_namespace.c +241 -66
  422. data/ext/pg_query/src_backend_catalog_pg_proc.c +1 -3
  423. data/ext/pg_query/src_backend_commands_define.c +2 -3
  424. data/ext/pg_query/src_backend_nodes_bitmapset.c +137 -94
  425. data/ext/pg_query/src_backend_nodes_copyfuncs.c +1 -1
  426. data/ext/pg_query/src_backend_nodes_equalfuncs.c +1 -1
  427. data/ext/pg_query/src_backend_nodes_extensible.c +1 -1
  428. data/ext/pg_query/src_backend_nodes_list.c +3 -7
  429. data/ext/pg_query/src_backend_nodes_makefuncs.c +59 -20
  430. data/ext/pg_query/src_backend_nodes_nodeFuncs.c +109 -2
  431. data/ext/pg_query/src_backend_nodes_value.c +1 -1
  432. data/ext/pg_query/src_backend_parser_gram.c +34491 -32136
  433. data/ext/pg_query/src_backend_parser_parser.c +8 -8
  434. data/ext/pg_query/src_backend_parser_scan.c +5637 -3028
  435. data/ext/pg_query/src_backend_parser_scansup.c +2 -1
  436. data/ext/pg_query/src_backend_storage_ipc_ipc.c +1 -1
  437. data/ext/pg_query/src_backend_tcop_postgres.c +34 -10
  438. data/ext/pg_query/src_backend_utils_activity_pgstat_database.c +2 -2
  439. data/ext/pg_query/src_backend_utils_adt_datum.c +8 -6
  440. data/ext/pg_query/src_backend_utils_adt_expandeddatum.c +1 -1
  441. data/ext/pg_query/src_backend_utils_adt_format_type.c +1 -1
  442. data/ext/pg_query/src_backend_utils_adt_numutils.c +4 -5
  443. data/ext/pg_query/src_backend_utils_adt_ruleutils.c +101 -28
  444. data/ext/pg_query/src_backend_utils_error_assert.c +1 -1
  445. data/ext/pg_query/src_backend_utils_error_elog.c +47 -42
  446. data/ext/pg_query/src_backend_utils_fmgr_fmgr.c +4 -2
  447. data/ext/pg_query/src_backend_utils_init_globals.c +15 -3
  448. data/ext/pg_query/src_backend_utils_mb_mbutils.c +11 -18
  449. data/ext/pg_query/src_backend_utils_misc_guc_tables.c +16 -6
  450. data/ext/pg_query/src_backend_utils_mmgr_alignedalloc.c +8 -5
  451. data/ext/pg_query/src_backend_utils_mmgr_aset.c +308 -238
  452. data/ext/pg_query/src_backend_utils_mmgr_bump.c +728 -0
  453. data/ext/pg_query/src_backend_utils_mmgr_generation.c +273 -197
  454. data/ext/pg_query/src_backend_utils_mmgr_mcxt.c +270 -215
  455. data/ext/pg_query/src_backend_utils_mmgr_slab.c +154 -96
  456. data/ext/pg_query/src_common_encnames.c +43 -44
  457. data/ext/pg_query/src_common_hashfn.c +1 -1
  458. data/ext/pg_query/src_common_keywords.c +1 -1
  459. data/ext/pg_query/src_common_kwlist_d.h +511 -466
  460. data/ext/pg_query/src_common_kwlookup.c +1 -1
  461. data/ext/pg_query/src_common_psprintf.c +3 -3
  462. data/ext/pg_query/src_common_stringinfo.c +18 -1
  463. data/ext/pg_query/src_common_wchar.c +92 -109
  464. data/ext/pg_query/src_pl_plpgsql_src_pl_comp.c +99 -5
  465. data/ext/pg_query/src_pl_plpgsql_src_pl_funcs.c +1 -1
  466. data/ext/pg_query/src_pl_plpgsql_src_pl_gram.c +242 -143
  467. data/ext/pg_query/src_pl_plpgsql_src_pl_handler.c +1 -1
  468. data/ext/pg_query/src_pl_plpgsql_src_pl_reserved_kwlist_d.h +1 -1
  469. data/ext/pg_query/src_pl_plpgsql_src_pl_scanner.c +19 -1
  470. data/ext/pg_query/src_pl_plpgsql_src_pl_unreserved_kwlist_d.h +1 -1
  471. data/ext/pg_query/src_port_pg_bitutils.c +173 -28
  472. data/ext/pg_query/src_port_pgstrcasecmp.c +29 -1
  473. data/ext/pg_query/src_port_snprintf.c +15 -18
  474. data/ext/pg_query/src_port_strerror.c +1 -3
  475. data/ext/pg_query/src_port_strlcpy.c +1 -1
  476. data/lib/pg_query/fingerprint.rb +3 -5
  477. data/lib/pg_query/param_refs.rb +2 -2
  478. data/lib/pg_query/parse.rb +5 -7
  479. data/lib/pg_query/parse_error.rb +1 -0
  480. data/lib/pg_query/pg_query_pb.rb +27 -25
  481. data/lib/pg_query/scan.rb +1 -0
  482. data/lib/pg_query/treewalker.rb +38 -15
  483. data/lib/pg_query/truncate.rb +18 -20
  484. data/lib/pg_query/version.rb +1 -1
  485. metadata +31 -82
  486. data/ext/pg_query/include/postgres/storage/backendid.h +0 -37
  487. data/ext/pg_query/include/postgres/storage/sinvaladt.h +0 -45
  488. data/ext/pg_query/pg_query_ruby_freebsd.sym +0 -2
  489. data/ext/pg_query/src_backend_nodes_nodes.c +0 -38
  490. /data/ext/pg_query/{pg_query_ruby.sym → ext_symbols.sym} +0 -0
@@ -7,7 +7,7 @@
7
7
  * and join trees.
8
8
  *
9
9
  *
10
- * Portions Copyright (c) 1996-2023, PostgreSQL Global Development Group
10
+ * Portions Copyright (c) 1996-2024, PostgreSQL Global Development Group
11
11
  * Portions Copyright (c) 1994, Regents of the University of California
12
12
  *
13
13
  * src/include/nodes/primnodes.h
@@ -22,6 +22,14 @@
22
22
  #include "nodes/pg_list.h"
23
23
 
24
24
 
25
+ typedef enum OverridingKind
26
+ {
27
+ OVERRIDING_NOT_SET = 0,
28
+ OVERRIDING_USER_VALUE,
29
+ OVERRIDING_SYSTEM_VALUE,
30
+ } OverridingKind;
31
+
32
+
25
33
  /* ----------------------------------------------------------------
26
34
  * node definitions
27
35
  * ----------------------------------------------------------------
@@ -49,7 +57,7 @@ typedef enum OnCommitAction
49
57
  ONCOMMIT_NOOP, /* No ON COMMIT clause (do nothing) */
50
58
  ONCOMMIT_PRESERVE_ROWS, /* ON COMMIT PRESERVE ROWS (do nothing) */
51
59
  ONCOMMIT_DELETE_ROWS, /* ON COMMIT DELETE ROWS */
52
- ONCOMMIT_DROP /* ON COMMIT DROP */
60
+ ONCOMMIT_DROP, /* ON COMMIT DROP */
53
61
  } OnCommitAction;
54
62
 
55
63
  /*
@@ -83,11 +91,17 @@ typedef struct RangeVar
83
91
  Alias *alias;
84
92
 
85
93
  /* token location, or -1 if unknown */
86
- int location;
94
+ ParseLoc location;
87
95
  } RangeVar;
88
96
 
97
+ typedef enum TableFuncType
98
+ {
99
+ TFT_XMLTABLE,
100
+ TFT_JSON_TABLE,
101
+ } TableFuncType;
102
+
89
103
  /*
90
- * TableFunc - node for a table function, such as XMLTABLE.
104
+ * TableFunc - node for a table function, such as XMLTABLE and JSON_TABLE.
91
105
  *
92
106
  * Entries in the ns_names list are either String nodes containing
93
107
  * literal namespace names, or NULL pointers to represent DEFAULT.
@@ -95,6 +109,8 @@ typedef struct RangeVar
95
109
  typedef struct TableFunc
96
110
  {
97
111
  NodeTag type;
112
+ /* XMLTABLE or JSON_TABLE */
113
+ TableFuncType functype;
98
114
  /* list of namespace URI expressions */
99
115
  List *ns_uris pg_node_attr(query_jumble_ignore);
100
116
  /* list of namespace names or NULL */
@@ -115,12 +131,18 @@ typedef struct TableFunc
115
131
  List *colexprs;
116
132
  /* list of column default expressions */
117
133
  List *coldefexprs pg_node_attr(query_jumble_ignore);
134
+ /* JSON_TABLE: list of column value expressions */
135
+ List *colvalexprs pg_node_attr(query_jumble_ignore);
136
+ /* JSON_TABLE: list of PASSING argument expressions */
137
+ List *passingvalexprs pg_node_attr(query_jumble_ignore);
118
138
  /* nullability flag for each output column */
119
139
  Bitmapset *notnulls pg_node_attr(query_jumble_ignore);
140
+ /* JSON_TABLE plan */
141
+ Node *plan pg_node_attr(query_jumble_ignore);
120
142
  /* counts from 0; -1 if none specified */
121
143
  int ordinalitycol pg_node_attr(query_jumble_ignore);
122
144
  /* token location, or -1 if unknown */
123
- int location;
145
+ ParseLoc location;
124
146
  } TableFunc;
125
147
 
126
148
  /*
@@ -268,7 +290,7 @@ typedef struct Var
268
290
  AttrNumber varattnosyn pg_node_attr(equal_ignore, query_jumble_ignore);
269
291
 
270
292
  /* token location, or -1 if unknown */
271
- int location;
293
+ ParseLoc location;
272
294
  } Var;
273
295
 
274
296
  /*
@@ -310,7 +332,7 @@ typedef struct Const
310
332
  * token location, or -1 if unknown. All constants are tracked as
311
333
  * locations in query jumbling, to be marked as parameters.
312
334
  */
313
- int location pg_node_attr(query_jumble_location);
335
+ ParseLoc location pg_node_attr(query_jumble_location);
314
336
  } Const;
315
337
 
316
338
  /*
@@ -345,7 +367,7 @@ typedef enum ParamKind
345
367
  PARAM_EXTERN,
346
368
  PARAM_EXEC,
347
369
  PARAM_SUBLINK,
348
- PARAM_MULTIEXPR
370
+ PARAM_MULTIEXPR,
349
371
  } ParamKind;
350
372
 
351
373
  typedef struct Param
@@ -359,7 +381,7 @@ typedef struct Param
359
381
  /* OID of collation, or InvalidOid if none */
360
382
  Oid paramcollid pg_node_attr(query_jumble_ignore);
361
383
  /* token location, or -1 if unknown */
362
- int location;
384
+ ParseLoc location;
363
385
  } Param;
364
386
 
365
387
  /*
@@ -482,7 +504,7 @@ typedef struct Aggref
482
504
  int aggtransno pg_node_attr(query_jumble_ignore);
483
505
 
484
506
  /* token location, or -1 if unknown */
485
- int location;
507
+ ParseLoc location;
486
508
  } Aggref;
487
509
 
488
510
  /*
@@ -529,7 +551,7 @@ typedef struct GroupingFunc
529
551
  Index agglevelsup;
530
552
 
531
553
  /* token location */
532
- int location;
554
+ ParseLoc location;
533
555
  } GroupingFunc;
534
556
 
535
557
  /*
@@ -553,6 +575,8 @@ typedef struct WindowFunc
553
575
  List *args;
554
576
  /* FILTER expression, if any */
555
577
  Expr *aggfilter;
578
+ /* List of WindowFuncRunConditions to help short-circuit execution */
579
+ List *runCondition pg_node_attr(query_jumble_ignore);
556
580
  /* index of associated WindowClause */
557
581
  Index winref;
558
582
  /* true if argument list was really '*' */
@@ -560,9 +584,58 @@ typedef struct WindowFunc
560
584
  /* is function a simple aggregate? */
561
585
  bool winagg pg_node_attr(query_jumble_ignore);
562
586
  /* token location, or -1 if unknown */
563
- int location;
587
+ ParseLoc location;
564
588
  } WindowFunc;
565
589
 
590
+ /*
591
+ * WindowFuncRunCondition
592
+ *
593
+ * Represents intermediate OpExprs which will be used by WindowAgg to
594
+ * short-circuit execution.
595
+ */
596
+ typedef struct WindowFuncRunCondition
597
+ {
598
+ Expr xpr;
599
+
600
+ /* PG_OPERATOR OID of the operator */
601
+ Oid opno;
602
+ /* OID of collation that operator should use */
603
+ Oid inputcollid pg_node_attr(query_jumble_ignore);
604
+
605
+ /*
606
+ * true of WindowFunc belongs on the left of the resulting OpExpr or false
607
+ * if the WindowFunc is on the right.
608
+ */
609
+ bool wfunc_left;
610
+
611
+ /*
612
+ * The Expr being compared to the WindowFunc to use in the OpExpr in the
613
+ * WindowAgg's runCondition
614
+ */
615
+ Expr *arg;
616
+ } WindowFuncRunCondition;
617
+
618
+ /*
619
+ * MergeSupportFunc
620
+ *
621
+ * A MergeSupportFunc is a merge support function expression that can only
622
+ * appear in the RETURNING list of a MERGE command. It returns information
623
+ * about the currently executing merge action.
624
+ *
625
+ * Currently, the only supported function is MERGE_ACTION(), which returns the
626
+ * command executed ("INSERT", "UPDATE", or "DELETE").
627
+ */
628
+ typedef struct MergeSupportFunc
629
+ {
630
+ Expr xpr;
631
+ /* type Oid of result */
632
+ Oid msftype;
633
+ /* OID of collation, or InvalidOid if none */
634
+ Oid msfcollid;
635
+ /* token location, or -1 if unknown */
636
+ ParseLoc location;
637
+ } MergeSupportFunc;
638
+
566
639
  /*
567
640
  * SubscriptingRef: describes a subscripting operation over a container
568
641
  * (array, etc).
@@ -641,7 +714,7 @@ typedef enum CoercionContext
641
714
  COERCION_IMPLICIT, /* coercion in context of expression */
642
715
  COERCION_ASSIGNMENT, /* coercion in context of assignment */
643
716
  COERCION_PLPGSQL, /* if no assignment cast, use CoerceViaIO */
644
- COERCION_EXPLICIT /* explicit cast operation */
717
+ COERCION_EXPLICIT, /* explicit cast operation */
645
718
  } CoercionContext;
646
719
 
647
720
  /*
@@ -661,7 +734,7 @@ typedef enum CoercionForm
661
734
  COERCE_EXPLICIT_CALL, /* display as a function call */
662
735
  COERCE_EXPLICIT_CAST, /* display as an explicit cast */
663
736
  COERCE_IMPLICIT_CAST, /* implicit cast, so hide it */
664
- COERCE_SQL_SYNTAX /* display with SQL-mandated special syntax */
737
+ COERCE_SQL_SYNTAX, /* display with SQL-mandated special syntax */
665
738
  } CoercionForm;
666
739
 
667
740
  /*
@@ -694,7 +767,7 @@ typedef struct FuncExpr
694
767
  /* arguments to the function */
695
768
  List *args;
696
769
  /* token location, or -1 if unknown */
697
- int location;
770
+ ParseLoc location;
698
771
  } FuncExpr;
699
772
 
700
773
  /*
@@ -721,7 +794,7 @@ typedef struct NamedArgExpr
721
794
  /* argument's number in positional notation */
722
795
  int argnumber;
723
796
  /* argument name location, or -1 if unknown */
724
- int location;
797
+ ParseLoc location;
725
798
  } NamedArgExpr;
726
799
 
727
800
  /*
@@ -763,7 +836,7 @@ typedef struct OpExpr
763
836
  List *args;
764
837
 
765
838
  /* token location, or -1 if unknown */
766
- int location;
839
+ ParseLoc location;
767
840
  } OpExpr;
768
841
 
769
842
  /*
@@ -843,7 +916,7 @@ typedef struct ScalarArrayOpExpr
843
916
  List *args;
844
917
 
845
918
  /* token location, or -1 if unknown */
846
- int location;
919
+ ParseLoc location;
847
920
  } ScalarArrayOpExpr;
848
921
 
849
922
  /*
@@ -865,7 +938,7 @@ typedef struct BoolExpr
865
938
  Expr xpr;
866
939
  BoolExprType boolop;
867
940
  List *args; /* arguments to this expression */
868
- int location; /* token location, or -1 if unknown */
941
+ ParseLoc location; /* token location, or -1 if unknown */
869
942
  } BoolExpr;
870
943
 
871
944
  /*
@@ -928,7 +1001,7 @@ typedef enum SubLinkType
928
1001
  EXPR_SUBLINK,
929
1002
  MULTIEXPR_SUBLINK,
930
1003
  ARRAY_SUBLINK,
931
- CTE_SUBLINK /* for SubPlans only */
1004
+ CTE_SUBLINK, /* for SubPlans only */
932
1005
  } SubLinkType;
933
1006
 
934
1007
 
@@ -942,7 +1015,7 @@ typedef struct SubLink
942
1015
  List *operName pg_node_attr(query_jumble_ignore);
943
1016
  /* subselect as Query* or raw parsetree */
944
1017
  Node *subselect;
945
- int location; /* token location, or -1 if unknown */
1018
+ ParseLoc location; /* token location, or -1 if unknown */
946
1019
  } SubLink;
947
1020
 
948
1021
  /*
@@ -1116,7 +1189,7 @@ typedef struct RelabelType
1116
1189
  Oid resultcollid pg_node_attr(query_jumble_ignore);
1117
1190
  /* how to display this node */
1118
1191
  CoercionForm relabelformat pg_node_attr(query_jumble_ignore);
1119
- int location; /* token location, or -1 if unknown */
1192
+ ParseLoc location; /* token location, or -1 if unknown */
1120
1193
  } RelabelType;
1121
1194
 
1122
1195
  /* ----------------
@@ -1138,7 +1211,7 @@ typedef struct CoerceViaIO
1138
1211
  Oid resultcollid pg_node_attr(query_jumble_ignore);
1139
1212
  /* how to display this node */
1140
1213
  CoercionForm coerceformat pg_node_attr(query_jumble_ignore);
1141
- int location; /* token location, or -1 if unknown */
1214
+ ParseLoc location; /* token location, or -1 if unknown */
1142
1215
  } CoerceViaIO;
1143
1216
 
1144
1217
  /* ----------------
@@ -1166,7 +1239,7 @@ typedef struct ArrayCoerceExpr
1166
1239
  Oid resultcollid pg_node_attr(query_jumble_ignore);
1167
1240
  /* how to display this node */
1168
1241
  CoercionForm coerceformat pg_node_attr(query_jumble_ignore);
1169
- int location; /* token location, or -1 if unknown */
1242
+ ParseLoc location; /* token location, or -1 if unknown */
1170
1243
  } ArrayCoerceExpr;
1171
1244
 
1172
1245
  /* ----------------
@@ -1190,7 +1263,7 @@ typedef struct ConvertRowtypeExpr
1190
1263
  /* Like RowExpr, we deliberately omit a typmod and collation here */
1191
1264
  /* how to display this node */
1192
1265
  CoercionForm convertformat pg_node_attr(query_jumble_ignore);
1193
- int location; /* token location, or -1 if unknown */
1266
+ ParseLoc location; /* token location, or -1 if unknown */
1194
1267
  } ConvertRowtypeExpr;
1195
1268
 
1196
1269
  /*----------
@@ -1205,7 +1278,7 @@ typedef struct CollateExpr
1205
1278
  Expr xpr;
1206
1279
  Expr *arg; /* input expression */
1207
1280
  Oid collOid; /* collation's OID */
1208
- int location; /* token location, or -1 if unknown */
1281
+ ParseLoc location; /* token location, or -1 if unknown */
1209
1282
  } CollateExpr;
1210
1283
 
1211
1284
  /*----------
@@ -1240,7 +1313,7 @@ typedef struct CaseExpr
1240
1313
  Expr *arg; /* implicit equality comparison argument */
1241
1314
  List *args; /* the arguments (list of WHEN clauses) */
1242
1315
  Expr *defresult; /* the default result (ELSE clause) */
1243
- int location; /* token location, or -1 if unknown */
1316
+ ParseLoc location; /* token location, or -1 if unknown */
1244
1317
  } CaseExpr;
1245
1318
 
1246
1319
  /*
@@ -1251,7 +1324,7 @@ typedef struct CaseWhen
1251
1324
  Expr xpr;
1252
1325
  Expr *expr; /* condition expression */
1253
1326
  Expr *result; /* substitution result */
1254
- int location; /* token location, or -1 if unknown */
1327
+ ParseLoc location; /* token location, or -1 if unknown */
1255
1328
  } CaseWhen;
1256
1329
 
1257
1330
  /*
@@ -1308,7 +1381,7 @@ typedef struct ArrayExpr
1308
1381
  /* true if elements are sub-arrays */
1309
1382
  bool multidims pg_node_attr(query_jumble_ignore);
1310
1383
  /* token location, or -1 if unknown */
1311
- int location;
1384
+ ParseLoc location;
1312
1385
  } ArrayExpr;
1313
1386
 
1314
1387
  /*
@@ -1359,7 +1432,7 @@ typedef struct RowExpr
1359
1432
  /* list of String, or NIL */
1360
1433
  List *colnames pg_node_attr(query_jumble_ignore);
1361
1434
 
1362
- int location; /* token location, or -1 if unknown */
1435
+ ParseLoc location; /* token location, or -1 if unknown */
1363
1436
  } RowExpr;
1364
1437
 
1365
1438
  /*
@@ -1384,7 +1457,7 @@ typedef enum RowCompareType
1384
1457
  ROWCOMPARE_EQ = 3, /* BTEqualStrategyNumber */
1385
1458
  ROWCOMPARE_GE = 4, /* BTGreaterEqualStrategyNumber */
1386
1459
  ROWCOMPARE_GT = 5, /* BTGreaterStrategyNumber */
1387
- ROWCOMPARE_NE = 6 /* no such btree strategy */
1460
+ ROWCOMPARE_NE = 6, /* no such btree strategy */
1388
1461
  } RowCompareType;
1389
1462
 
1390
1463
  typedef struct RowCompareExpr
@@ -1418,7 +1491,7 @@ typedef struct CoalesceExpr
1418
1491
  /* the arguments */
1419
1492
  List *args;
1420
1493
  /* token location, or -1 if unknown */
1421
- int location;
1494
+ ParseLoc location;
1422
1495
  } CoalesceExpr;
1423
1496
 
1424
1497
  /*
@@ -1444,7 +1517,7 @@ typedef struct MinMaxExpr
1444
1517
  /* the arguments */
1445
1518
  List *args;
1446
1519
  /* token location, or -1 if unknown */
1447
- int location;
1520
+ ParseLoc location;
1448
1521
  } MinMaxExpr;
1449
1522
 
1450
1523
  /*
@@ -1474,7 +1547,7 @@ typedef enum SQLValueFunctionOp
1474
1547
  SVFOP_USER,
1475
1548
  SVFOP_SESSION_USER,
1476
1549
  SVFOP_CURRENT_CATALOG,
1477
- SVFOP_CURRENT_SCHEMA
1550
+ SVFOP_CURRENT_SCHEMA,
1478
1551
  } SQLValueFunctionOp;
1479
1552
 
1480
1553
  typedef struct SQLValueFunction
@@ -1488,7 +1561,7 @@ typedef struct SQLValueFunction
1488
1561
  */
1489
1562
  Oid type pg_node_attr(query_jumble_ignore);
1490
1563
  int32 typmod;
1491
- int location; /* token location, or -1 if unknown */
1564
+ ParseLoc location; /* token location, or -1 if unknown */
1492
1565
  } SQLValueFunction;
1493
1566
 
1494
1567
  /*
@@ -1511,13 +1584,13 @@ typedef enum XmlExprOp
1511
1584
  IS_XMLPI, /* XMLPI(name [, args]) */
1512
1585
  IS_XMLROOT, /* XMLROOT(xml, version, standalone) */
1513
1586
  IS_XMLSERIALIZE, /* XMLSERIALIZE(is_document, xmlval, indent) */
1514
- IS_DOCUMENT /* xmlval IS DOCUMENT */
1587
+ IS_DOCUMENT, /* xmlval IS DOCUMENT */
1515
1588
  } XmlExprOp;
1516
1589
 
1517
1590
  typedef enum XmlOptionType
1518
1591
  {
1519
1592
  XMLOPTION_DOCUMENT,
1520
- XMLOPTION_CONTENT
1593
+ XMLOPTION_CONTENT,
1521
1594
  } XmlOptionType;
1522
1595
 
1523
1596
  typedef struct XmlExpr
@@ -1541,7 +1614,7 @@ typedef struct XmlExpr
1541
1614
  Oid type pg_node_attr(query_jumble_ignore);
1542
1615
  int32 typmod pg_node_attr(query_jumble_ignore);
1543
1616
  /* token location, or -1 if unknown */
1544
- int location;
1617
+ ParseLoc location;
1545
1618
  } XmlExpr;
1546
1619
 
1547
1620
  /*
@@ -1564,7 +1637,7 @@ typedef enum JsonFormatType
1564
1637
  {
1565
1638
  JS_FORMAT_DEFAULT, /* unspecified */
1566
1639
  JS_FORMAT_JSON, /* FORMAT JSON [ENCODING ...] */
1567
- JS_FORMAT_JSONB /* implicit internal format for RETURNING
1640
+ JS_FORMAT_JSONB, /* implicit internal format for RETURNING
1568
1641
  * jsonb */
1569
1642
  } JsonFormatType;
1570
1643
 
@@ -1577,7 +1650,7 @@ typedef struct JsonFormat
1577
1650
  NodeTag type;
1578
1651
  JsonFormatType format_type; /* format type */
1579
1652
  JsonEncoding encoding; /* JSON encoding */
1580
- int location; /* token location, or -1 if unknown */
1653
+ ParseLoc location; /* token location, or -1 if unknown */
1581
1654
  } JsonFormat;
1582
1655
 
1583
1656
  /*
@@ -1596,15 +1669,19 @@ typedef struct JsonReturning
1596
1669
  * JsonValueExpr -
1597
1670
  * representation of JSON value expression (expr [FORMAT JsonFormat])
1598
1671
  *
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().
1672
+ * raw_expr is the user-specified value, while formatted_expr is the value
1673
+ * obtained by coercing raw_expr to the type required by either the FORMAT
1674
+ * clause or an enclosing node's RETURNING clause.
1675
+ *
1676
+ * When deparsing a JsonValueExpr, get_rule_expr() prints raw_expr. However,
1677
+ * during the evaluation of a JsonValueExpr, the value of formatted_expr
1678
+ * takes precedence over that of raw_expr.
1602
1679
  */
1603
1680
  typedef struct JsonValueExpr
1604
1681
  {
1605
1682
  NodeTag type;
1606
- Expr *raw_expr; /* raw expression */
1607
- Expr *formatted_expr; /* formatted expression */
1683
+ Expr *raw_expr; /* user-specified expression */
1684
+ Expr *formatted_expr; /* coerced formatted expression */
1608
1685
  JsonFormat *format; /* FORMAT clause, if specified */
1609
1686
  } JsonValueExpr;
1610
1687
 
@@ -1613,7 +1690,10 @@ typedef enum JsonConstructorType
1613
1690
  JSCTOR_JSON_OBJECT = 1,
1614
1691
  JSCTOR_JSON_ARRAY = 2,
1615
1692
  JSCTOR_JSON_OBJECTAGG = 3,
1616
- JSCTOR_JSON_ARRAYAGG = 4
1693
+ JSCTOR_JSON_ARRAYAGG = 4,
1694
+ JSCTOR_JSON_PARSE = 5,
1695
+ JSCTOR_JSON_SCALAR = 6,
1696
+ JSCTOR_JSON_SERIALIZE = 7,
1617
1697
  } JsonConstructorType;
1618
1698
 
1619
1699
  /*
@@ -1630,7 +1710,7 @@ typedef struct JsonConstructorExpr
1630
1710
  JsonReturning *returning; /* RETURNING clause */
1631
1711
  bool absent_on_null; /* ABSENT ON NULL? */
1632
1712
  bool unique; /* WITH UNIQUE KEYS? (JSON_OBJECT[AGG] only) */
1633
- int location;
1713
+ ParseLoc location;
1634
1714
  } JsonConstructorExpr;
1635
1715
 
1636
1716
  /*
@@ -1642,7 +1722,7 @@ typedef enum JsonValueType
1642
1722
  JS_TYPE_ANY, /* IS JSON [VALUE] */
1643
1723
  JS_TYPE_OBJECT, /* IS JSON OBJECT */
1644
1724
  JS_TYPE_ARRAY, /* IS JSON ARRAY */
1645
- JS_TYPE_SCALAR /* IS JSON SCALAR */
1725
+ JS_TYPE_SCALAR, /* IS JSON SCALAR */
1646
1726
  } JsonValueType;
1647
1727
 
1648
1728
  /*
@@ -1656,9 +1736,198 @@ typedef struct JsonIsPredicate
1656
1736
  JsonFormat *format; /* FORMAT clause, if specified */
1657
1737
  JsonValueType item_type; /* JSON item type */
1658
1738
  bool unique_keys; /* check key uniqueness? */
1659
- int location; /* token location, or -1 if unknown */
1739
+ ParseLoc location; /* token location, or -1 if unknown */
1660
1740
  } JsonIsPredicate;
1661
1741
 
1742
+ /* Nodes used in SQL/JSON query functions */
1743
+
1744
+ /*
1745
+ * JsonWrapper -
1746
+ * representation of WRAPPER clause for JSON_QUERY()
1747
+ */
1748
+ typedef enum JsonWrapper
1749
+ {
1750
+ JSW_UNSPEC,
1751
+ JSW_NONE,
1752
+ JSW_CONDITIONAL,
1753
+ JSW_UNCONDITIONAL,
1754
+ } JsonWrapper;
1755
+
1756
+ /*
1757
+ * JsonBehaviorType -
1758
+ * enumeration of behavior types used in SQL/JSON ON ERROR/EMPTY clauses
1759
+ *
1760
+ * If enum members are reordered, get_json_behavior() from ruleutils.c
1761
+ * must be updated accordingly.
1762
+ */
1763
+ typedef enum JsonBehaviorType
1764
+ {
1765
+ JSON_BEHAVIOR_NULL = 0,
1766
+ JSON_BEHAVIOR_ERROR,
1767
+ JSON_BEHAVIOR_EMPTY,
1768
+ JSON_BEHAVIOR_TRUE,
1769
+ JSON_BEHAVIOR_FALSE,
1770
+ JSON_BEHAVIOR_UNKNOWN,
1771
+ JSON_BEHAVIOR_EMPTY_ARRAY,
1772
+ JSON_BEHAVIOR_EMPTY_OBJECT,
1773
+ JSON_BEHAVIOR_DEFAULT,
1774
+ } JsonBehaviorType;
1775
+
1776
+ /*
1777
+ * JsonBehavior
1778
+ * Specifications for ON ERROR / ON EMPTY behaviors of SQL/JSON
1779
+ * query functions specified by a JsonExpr
1780
+ *
1781
+ * 'expr' is the expression to emit when a given behavior (EMPTY or ERROR)
1782
+ * occurs on evaluating the SQL/JSON query function. 'coerce' is set to true
1783
+ * if 'expr' isn't already of the expected target type given by
1784
+ * JsonExpr.returning.
1785
+ */
1786
+ typedef struct JsonBehavior
1787
+ {
1788
+ NodeTag type;
1789
+
1790
+ JsonBehaviorType btype;
1791
+ Node *expr;
1792
+ bool coerce;
1793
+ ParseLoc location; /* token location, or -1 if unknown */
1794
+ } JsonBehavior;
1795
+
1796
+ /*
1797
+ * JsonExprOp -
1798
+ * enumeration of SQL/JSON query function types
1799
+ */
1800
+ typedef enum JsonExprOp
1801
+ {
1802
+ JSON_EXISTS_OP, /* JSON_EXISTS() */
1803
+ JSON_QUERY_OP, /* JSON_QUERY() */
1804
+ JSON_VALUE_OP, /* JSON_VALUE() */
1805
+ JSON_TABLE_OP, /* JSON_TABLE() */
1806
+ } JsonExprOp;
1807
+
1808
+ /*
1809
+ * JsonExpr -
1810
+ * Transformed representation of JSON_VALUE(), JSON_QUERY(), and
1811
+ * JSON_EXISTS()
1812
+ */
1813
+ typedef struct JsonExpr
1814
+ {
1815
+ Expr xpr;
1816
+
1817
+ JsonExprOp op;
1818
+
1819
+ char *column_name; /* JSON_TABLE() column name or NULL if this is
1820
+ * not for a JSON_TABLE() */
1821
+
1822
+ /* jsonb-valued expression to query */
1823
+ Node *formatted_expr;
1824
+
1825
+ /* Format of the above expression needed by ruleutils.c */
1826
+ JsonFormat *format;
1827
+
1828
+ /* jsonpath-valued expression containing the query pattern */
1829
+ Node *path_spec;
1830
+
1831
+ /* Expected type/format of the output. */
1832
+ JsonReturning *returning;
1833
+
1834
+ /* Information about the PASSING argument expressions */
1835
+ List *passing_names;
1836
+ List *passing_values;
1837
+
1838
+ /* User-specified or default ON EMPTY and ON ERROR behaviors */
1839
+ JsonBehavior *on_empty;
1840
+ JsonBehavior *on_error;
1841
+
1842
+ /*
1843
+ * Information about converting the result of jsonpath functions
1844
+ * JsonPathQuery() and JsonPathValue() to the RETURNING type.
1845
+ */
1846
+ bool use_io_coercion;
1847
+ bool use_json_coercion;
1848
+
1849
+ /* WRAPPER specification for JSON_QUERY */
1850
+ JsonWrapper wrapper;
1851
+
1852
+ /* KEEP or OMIT QUOTES for singleton scalars returned by JSON_QUERY() */
1853
+ bool omit_quotes;
1854
+
1855
+ /* JsonExpr's collation. */
1856
+ Oid collation;
1857
+
1858
+ /* Original JsonFuncExpr's location */
1859
+ ParseLoc location;
1860
+ } JsonExpr;
1861
+
1862
+ /*
1863
+ * JsonTablePath
1864
+ * A JSON path expression to be computed as part of evaluating
1865
+ * a JSON_TABLE plan node
1866
+ */
1867
+ typedef struct JsonTablePath
1868
+ {
1869
+ NodeTag type;
1870
+
1871
+ Const *value;
1872
+ char *name;
1873
+ } JsonTablePath;
1874
+
1875
+ /*
1876
+ * JsonTablePlan -
1877
+ * Abstract class to represent different types of JSON_TABLE "plans".
1878
+ * A plan is used to generate a "row pattern" value by evaluating a JSON
1879
+ * path expression against an input JSON document, which is then used for
1880
+ * populating JSON_TABLE() columns
1881
+ */
1882
+ typedef struct JsonTablePlan
1883
+ {
1884
+ pg_node_attr(abstract)
1885
+
1886
+ NodeTag type;
1887
+ } JsonTablePlan;
1888
+
1889
+ /*
1890
+ * JSON_TABLE plan to evaluate a JSON path expression and NESTED paths, if
1891
+ * any.
1892
+ */
1893
+ typedef struct JsonTablePathScan
1894
+ {
1895
+ JsonTablePlan plan;
1896
+
1897
+ /* JSON path to evaluate */
1898
+ JsonTablePath *path;
1899
+
1900
+ /*
1901
+ * ERROR/EMPTY ON ERROR behavior; only significant in the plan for the
1902
+ * top-level path.
1903
+ */
1904
+ bool errorOnError;
1905
+
1906
+ /* Plan(s) for nested columns, if any. */
1907
+ JsonTablePlan *child;
1908
+
1909
+ /*
1910
+ * 0-based index in TableFunc.colvalexprs of the 1st and the last column
1911
+ * covered by this plan. Both are -1 if all columns are nested and thus
1912
+ * computed by the child plan(s).
1913
+ */
1914
+ int colMin;
1915
+ int colMax;
1916
+ } JsonTablePathScan;
1917
+
1918
+ /*
1919
+ * JsonTableSiblingJoin -
1920
+ * Plan to join rows of sibling NESTED COLUMNS clauses in the same parent
1921
+ * COLUMNS clause
1922
+ */
1923
+ typedef struct JsonTableSiblingJoin
1924
+ {
1925
+ JsonTablePlan plan;
1926
+
1927
+ JsonTablePlan *lplan;
1928
+ JsonTablePlan *rplan;
1929
+ } JsonTableSiblingJoin;
1930
+
1662
1931
  /* ----------------
1663
1932
  * NullTest
1664
1933
  *
@@ -1690,7 +1959,7 @@ typedef struct NullTest
1690
1959
  NullTestType nulltesttype; /* IS NULL, IS NOT NULL */
1691
1960
  /* T to perform field-by-field null checks */
1692
1961
  bool argisrow pg_node_attr(query_jumble_ignore);
1693
- int location; /* token location, or -1 if unknown */
1962
+ ParseLoc location; /* token location, or -1 if unknown */
1694
1963
  } NullTest;
1695
1964
 
1696
1965
  /*
@@ -1712,9 +1981,38 @@ typedef struct BooleanTest
1712
1981
  Expr xpr;
1713
1982
  Expr *arg; /* input expression */
1714
1983
  BoolTestType booltesttype; /* test type */
1715
- int location; /* token location, or -1 if unknown */
1984
+ ParseLoc location; /* token location, or -1 if unknown */
1716
1985
  } BooleanTest;
1717
1986
 
1987
+
1988
+ /*
1989
+ * MergeAction
1990
+ *
1991
+ * Transformed representation of a WHEN clause in a MERGE statement
1992
+ */
1993
+
1994
+ typedef enum MergeMatchKind
1995
+ {
1996
+ MERGE_WHEN_MATCHED,
1997
+ MERGE_WHEN_NOT_MATCHED_BY_SOURCE,
1998
+ MERGE_WHEN_NOT_MATCHED_BY_TARGET
1999
+ } MergeMatchKind;
2000
+
2001
+ #define NUM_MERGE_MATCH_KINDS (MERGE_WHEN_NOT_MATCHED_BY_TARGET + 1)
2002
+
2003
+ typedef struct MergeAction
2004
+ {
2005
+ NodeTag type;
2006
+ MergeMatchKind matchKind; /* MATCHED/NOT MATCHED BY SOURCE/TARGET */
2007
+ CmdType commandType; /* INSERT/UPDATE/DELETE/DO NOTHING */
2008
+ /* OVERRIDING clause */
2009
+ OverridingKind override pg_node_attr(query_jumble_ignore);
2010
+ Node *qual; /* transformed WHEN conditions */
2011
+ List *targetList; /* the target list (of TargetEntry) */
2012
+ /* target attribute numbers of an UPDATE */
2013
+ List *updateColnos pg_node_attr(query_jumble_ignore);
2014
+ } MergeAction;
2015
+
1718
2016
  /*
1719
2017
  * CoerceToDomain
1720
2018
  *
@@ -1735,7 +2033,7 @@ typedef struct CoerceToDomain
1735
2033
  Oid resultcollid pg_node_attr(query_jumble_ignore);
1736
2034
  /* how to display this node */
1737
2035
  CoercionForm coercionformat pg_node_attr(query_jumble_ignore);
1738
- int location; /* token location, or -1 if unknown */
2036
+ ParseLoc location; /* token location, or -1 if unknown */
1739
2037
  } CoerceToDomain;
1740
2038
 
1741
2039
  /*
@@ -1757,7 +2055,7 @@ typedef struct CoerceToDomainValue
1757
2055
  /* collation for the substituted value */
1758
2056
  Oid collation pg_node_attr(query_jumble_ignore);
1759
2057
  /* token location, or -1 if unknown */
1760
- int location;
2058
+ ParseLoc location;
1761
2059
  } CoerceToDomainValue;
1762
2060
 
1763
2061
  /*
@@ -1777,7 +2075,7 @@ typedef struct SetToDefault
1777
2075
  /* collation for the substituted value */
1778
2076
  Oid collation pg_node_attr(query_jumble_ignore);
1779
2077
  /* token location, or -1 if unknown */
1780
- int location;
2078
+ ParseLoc location;
1781
2079
  } SetToDefault;
1782
2080
 
1783
2081
  /*