pg_query 4.2.1 → 5.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 (531) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +31 -0
  3. data/README.md +6 -8
  4. data/Rakefile +5 -6
  5. data/ext/pg_query/extconf.rb +14 -4
  6. data/ext/pg_query/include/pg_query.h +27 -3
  7. data/ext/pg_query/include/pg_query_enum_defs.c +311 -149
  8. data/ext/pg_query/include/pg_query_fingerprint_conds.c +545 -489
  9. data/ext/pg_query/include/pg_query_fingerprint_defs.c +5092 -4432
  10. data/ext/pg_query/include/pg_query_outfuncs_conds.c +385 -343
  11. data/ext/pg_query/include/pg_query_outfuncs_defs.c +1294 -1161
  12. data/ext/pg_query/include/pg_query_readfuncs_conds.c +137 -123
  13. data/ext/pg_query/include/pg_query_readfuncs_defs.c +1657 -1496
  14. data/ext/pg_query/include/{access → postgres/access}/amapi.h +3 -1
  15. data/ext/pg_query/include/{access → postgres/access}/attmap.h +5 -3
  16. data/ext/pg_query/include/{access → postgres/access}/attnum.h +1 -1
  17. data/ext/pg_query/include/{access → postgres/access}/clog.h +1 -1
  18. data/ext/pg_query/include/{access → postgres/access}/commit_ts.h +1 -1
  19. data/ext/pg_query/include/{access → postgres/access}/detoast.h +1 -1
  20. data/ext/pg_query/include/{access → postgres/access}/genam.h +7 -5
  21. data/ext/pg_query/include/{access → postgres/access}/gin.h +16 -3
  22. data/ext/pg_query/include/{access → postgres/access}/htup.h +1 -1
  23. data/ext/pg_query/include/{access → postgres/access}/htup_details.h +6 -2
  24. data/ext/pg_query/include/{access → postgres/access}/itup.h +61 -58
  25. data/ext/pg_query/include/{access → postgres/access}/parallel.h +2 -2
  26. data/ext/pg_query/include/{access → postgres/access}/printtup.h +1 -1
  27. data/ext/pg_query/include/{access → postgres/access}/relation.h +1 -1
  28. data/ext/pg_query/include/{access → postgres/access}/relscan.h +1 -1
  29. data/ext/pg_query/include/{access → postgres/access}/rmgrlist.h +2 -2
  30. data/ext/pg_query/include/{access → postgres/access}/sdir.h +12 -3
  31. data/ext/pg_query/include/{access → postgres/access}/skey.h +1 -1
  32. data/ext/pg_query/include/{access → postgres/access}/stratnum.h +1 -1
  33. data/ext/pg_query/include/{access → postgres/access}/sysattr.h +1 -1
  34. data/ext/pg_query/include/{access → postgres/access}/table.h +1 -1
  35. data/ext/pg_query/include/{access → postgres/access}/tableam.h +68 -45
  36. data/ext/pg_query/include/{access → postgres/access}/toast_compression.h +1 -1
  37. data/ext/pg_query/include/{access → postgres/access}/transam.h +1 -1
  38. data/ext/pg_query/include/postgres/access/tsmapi.h +82 -0
  39. data/ext/pg_query/include/{access → postgres/access}/tupconvert.h +5 -2
  40. data/ext/pg_query/include/{access → postgres/access}/tupdesc.h +2 -2
  41. data/ext/pg_query/include/{access → postgres/access}/tupmacs.h +58 -98
  42. data/ext/pg_query/include/{access → postgres/access}/twophase.h +2 -2
  43. data/ext/pg_query/include/{access → postgres/access}/xact.h +25 -18
  44. data/ext/pg_query/include/{access → postgres/access}/xlog.h +15 -16
  45. data/ext/pg_query/include/{access → postgres/access}/xlog_internal.h +100 -62
  46. data/ext/pg_query/include/postgres/access/xlogbackup.h +41 -0
  47. data/ext/pg_query/include/{access → postgres/access}/xlogdefs.h +6 -25
  48. data/ext/pg_query/include/{access → postgres/access}/xlogprefetcher.h +1 -1
  49. data/ext/pg_query/include/{access → postgres/access}/xlogreader.h +7 -6
  50. data/ext/pg_query/include/{access → postgres/access}/xlogrecord.h +17 -5
  51. data/ext/pg_query/include/{access → postgres/access}/xlogrecovery.h +4 -3
  52. data/ext/pg_query/include/postgres/archive/archive_module.h +59 -0
  53. data/ext/pg_query/include/{c.h → postgres/c.h} +144 -156
  54. data/ext/pg_query/include/{catalog → postgres/catalog}/catalog.h +4 -3
  55. data/ext/pg_query/include/{catalog → postgres/catalog}/catversion.h +6 -2
  56. data/ext/pg_query/include/{catalog → postgres/catalog}/dependency.h +5 -4
  57. data/ext/pg_query/include/{catalog → postgres/catalog}/genbki.h +7 -6
  58. data/ext/pg_query/include/{catalog → postgres/catalog}/index.h +4 -4
  59. data/ext/pg_query/include/{catalog → postgres/catalog}/indexing.h +1 -1
  60. data/ext/pg_query/include/{catalog → postgres/catalog}/namespace.h +2 -2
  61. data/ext/pg_query/include/{catalog → postgres/catalog}/objectaccess.h +10 -8
  62. data/ext/pg_query/include/{catalog → postgres/catalog}/objectaddress.h +3 -3
  63. data/ext/pg_query/include/{catalog → postgres/catalog}/pg_aggregate.h +1 -1
  64. data/ext/pg_query/include/{catalog → postgres/catalog}/pg_aggregate_d.h +1 -1
  65. data/ext/pg_query/include/{catalog → postgres/catalog}/pg_am.h +1 -1
  66. data/ext/pg_query/include/{catalog → postgres/catalog}/pg_am_d.h +1 -1
  67. data/ext/pg_query/include/{catalog → postgres/catalog}/pg_attribute.h +19 -17
  68. data/ext/pg_query/include/{catalog → postgres/catalog}/pg_attribute_d.h +19 -19
  69. data/ext/pg_query/include/{catalog → postgres/catalog}/pg_authid.h +1 -1
  70. data/ext/pg_query/include/{catalog → postgres/catalog}/pg_authid_d.h +3 -1
  71. data/ext/pg_query/include/{catalog → postgres/catalog}/pg_class.h +1 -1
  72. data/ext/pg_query/include/{catalog → postgres/catalog}/pg_class_d.h +1 -1
  73. data/ext/pg_query/include/{catalog → postgres/catalog}/pg_collation.h +3 -1
  74. data/ext/pg_query/include/{catalog → postgres/catalog}/pg_collation_d.h +4 -3
  75. data/ext/pg_query/include/{catalog → postgres/catalog}/pg_constraint.h +2 -2
  76. data/ext/pg_query/include/{catalog → postgres/catalog}/pg_constraint_d.h +1 -1
  77. data/ext/pg_query/include/{catalog → postgres/catalog}/pg_control.h +9 -1
  78. data/ext/pg_query/include/{catalog → postgres/catalog}/pg_conversion.h +2 -2
  79. data/ext/pg_query/include/{catalog → postgres/catalog}/pg_conversion_d.h +1 -1
  80. data/ext/pg_query/include/postgres/catalog/pg_database.h +124 -0
  81. data/ext/pg_query/include/postgres/catalog/pg_database_d.h +52 -0
  82. data/ext/pg_query/include/{catalog → postgres/catalog}/pg_depend.h +1 -1
  83. data/ext/pg_query/include/{catalog → postgres/catalog}/pg_depend_d.h +1 -1
  84. data/ext/pg_query/include/{catalog → postgres/catalog}/pg_event_trigger.h +1 -1
  85. data/ext/pg_query/include/{catalog → postgres/catalog}/pg_event_trigger_d.h +1 -1
  86. data/ext/pg_query/include/{catalog → postgres/catalog}/pg_index.h +1 -1
  87. data/ext/pg_query/include/{catalog → postgres/catalog}/pg_index_d.h +1 -1
  88. data/ext/pg_query/include/{catalog → postgres/catalog}/pg_language.h +1 -1
  89. data/ext/pg_query/include/{catalog → postgres/catalog}/pg_language_d.h +1 -1
  90. data/ext/pg_query/include/{catalog → postgres/catalog}/pg_namespace.h +1 -1
  91. data/ext/pg_query/include/{catalog → postgres/catalog}/pg_namespace_d.h +1 -1
  92. data/ext/pg_query/include/{catalog → postgres/catalog}/pg_opclass.h +1 -1
  93. data/ext/pg_query/include/{catalog → postgres/catalog}/pg_opclass_d.h +1 -1
  94. data/ext/pg_query/include/{catalog → postgres/catalog}/pg_operator.h +1 -1
  95. data/ext/pg_query/include/{catalog → postgres/catalog}/pg_operator_d.h +1 -1
  96. data/ext/pg_query/include/{catalog → postgres/catalog}/pg_opfamily.h +3 -2
  97. data/ext/pg_query/include/{catalog → postgres/catalog}/pg_opfamily_d.h +4 -2
  98. data/ext/pg_query/include/{catalog → postgres/catalog}/pg_partitioned_table.h +1 -1
  99. data/ext/pg_query/include/{catalog → postgres/catalog}/pg_partitioned_table_d.h +1 -1
  100. data/ext/pg_query/include/{catalog → postgres/catalog}/pg_proc.h +1 -1
  101. data/ext/pg_query/include/{catalog → postgres/catalog}/pg_proc_d.h +1 -1
  102. data/ext/pg_query/include/{catalog → postgres/catalog}/pg_publication.h +2 -5
  103. data/ext/pg_query/include/{catalog → postgres/catalog}/pg_publication_d.h +1 -1
  104. data/ext/pg_query/include/{catalog → postgres/catalog}/pg_replication_origin.h +1 -1
  105. data/ext/pg_query/include/{catalog → postgres/catalog}/pg_replication_origin_d.h +1 -1
  106. data/ext/pg_query/include/{catalog → postgres/catalog}/pg_statistic.h +1 -1
  107. data/ext/pg_query/include/{catalog → postgres/catalog}/pg_statistic_d.h +1 -1
  108. data/ext/pg_query/include/{catalog → postgres/catalog}/pg_statistic_ext.h +1 -1
  109. data/ext/pg_query/include/{catalog → postgres/catalog}/pg_statistic_ext_d.h +1 -1
  110. data/ext/pg_query/include/{catalog → postgres/catalog}/pg_transform.h +1 -1
  111. data/ext/pg_query/include/{catalog → postgres/catalog}/pg_transform_d.h +1 -1
  112. data/ext/pg_query/include/{catalog → postgres/catalog}/pg_trigger.h +1 -1
  113. data/ext/pg_query/include/{catalog → postgres/catalog}/pg_trigger_d.h +1 -1
  114. data/ext/pg_query/include/{catalog → postgres/catalog}/pg_ts_config.h +1 -1
  115. data/ext/pg_query/include/{catalog → postgres/catalog}/pg_ts_config_d.h +1 -1
  116. data/ext/pg_query/include/{catalog → postgres/catalog}/pg_ts_dict.h +1 -1
  117. data/ext/pg_query/include/{catalog → postgres/catalog}/pg_ts_dict_d.h +1 -1
  118. data/ext/pg_query/include/{catalog → postgres/catalog}/pg_ts_parser.h +1 -1
  119. data/ext/pg_query/include/{catalog → postgres/catalog}/pg_ts_parser_d.h +1 -1
  120. data/ext/pg_query/include/{catalog → postgres/catalog}/pg_ts_template.h +1 -1
  121. data/ext/pg_query/include/{catalog → postgres/catalog}/pg_ts_template_d.h +1 -1
  122. data/ext/pg_query/include/{catalog → postgres/catalog}/pg_type.h +1 -1
  123. data/ext/pg_query/include/{catalog → postgres/catalog}/pg_type_d.h +1 -1
  124. data/ext/pg_query/include/{catalog → postgres/catalog}/storage.h +6 -6
  125. data/ext/pg_query/include/{commands → postgres/commands}/async.h +1 -1
  126. data/ext/pg_query/include/{commands → postgres/commands}/dbcommands.h +2 -1
  127. data/ext/pg_query/include/{commands → postgres/commands}/defrem.h +2 -1
  128. data/ext/pg_query/include/{commands → postgres/commands}/event_trigger.h +1 -1
  129. data/ext/pg_query/include/{commands → postgres/commands}/explain.h +3 -1
  130. data/ext/pg_query/include/{commands → postgres/commands}/prepare.h +1 -1
  131. data/ext/pg_query/include/{commands → postgres/commands}/tablespace.h +4 -4
  132. data/ext/pg_query/include/{commands → postgres/commands}/trigger.h +15 -14
  133. data/ext/pg_query/include/{commands → postgres/commands}/user.h +9 -3
  134. data/ext/pg_query/include/{commands → postgres/commands}/vacuum.h +60 -14
  135. data/ext/pg_query/include/postgres/common/cryptohash.h +39 -0
  136. data/ext/pg_query/include/{common → postgres/common}/file_perm.h +1 -1
  137. data/ext/pg_query/include/{common → postgres/common}/hashfn.h +1 -1
  138. data/ext/pg_query/include/postgres/common/int.h +437 -0
  139. data/ext/pg_query/include/{common → postgres/common}/keywords.h +1 -1
  140. data/ext/pg_query/include/{common → postgres/common}/kwlookup.h +2 -2
  141. data/ext/pg_query/include/{common → postgres/common}/pg_prng.h +3 -2
  142. data/ext/pg_query/include/{common → postgres/common}/relpath.h +20 -13
  143. data/ext/pg_query/include/postgres/common/scram-common.h +70 -0
  144. data/ext/pg_query/include/postgres/common/sha2.h +32 -0
  145. data/ext/pg_query/include/{common → postgres/common}/string.h +5 -3
  146. data/ext/pg_query/include/{common → postgres/common}/unicode_east_asian_fw_table.h +10 -10
  147. data/ext/pg_query/include/{common/unicode_combining_table.h → postgres/common/unicode_nonspacing_table.h} +31 -13
  148. data/ext/pg_query/include/postgres/copyfuncs.funcs.c +5013 -0
  149. data/ext/pg_query/include/postgres/copyfuncs.switch.c +938 -0
  150. data/ext/pg_query/include/{datatype → postgres/datatype}/timestamp.h +11 -4
  151. data/ext/pg_query/include/postgres/equalfuncs.funcs.c +3097 -0
  152. data/ext/pg_query/include/postgres/equalfuncs.switch.c +785 -0
  153. data/ext/pg_query/include/{executor → postgres/executor}/execdesc.h +1 -1
  154. data/ext/pg_query/include/{executor → postgres/executor}/executor.h +34 -17
  155. data/ext/pg_query/include/{executor → postgres/executor}/functions.h +1 -1
  156. data/ext/pg_query/include/{executor → postgres/executor}/instrument.h +1 -1
  157. data/ext/pg_query/include/{executor → postgres/executor}/spi.h +2 -2
  158. data/ext/pg_query/include/{executor → postgres/executor}/tablefunc.h +1 -1
  159. data/ext/pg_query/include/{executor → postgres/executor}/tuptable.h +18 -11
  160. data/ext/pg_query/include/{fmgr.h → postgres/fmgr.h} +21 -2
  161. data/ext/pg_query/include/postgres/foreign/fdwapi.h +294 -0
  162. data/ext/pg_query/include/{funcapi.h → postgres/funcapi.h} +12 -12
  163. data/ext/pg_query/include/postgres/gram.h +1127 -0
  164. data/ext/pg_query/include/{parser → postgres}/gramparse.h +4 -4
  165. data/ext/pg_query/include/{jit → postgres/jit}/jit.h +2 -2
  166. data/ext/pg_query/include/postgres/kwlist_d.h +1119 -0
  167. data/ext/pg_query/include/{lib → postgres/lib}/dshash.h +4 -1
  168. data/ext/pg_query/include/{lib → postgres/lib}/ilist.h +435 -22
  169. data/ext/pg_query/include/{lib → postgres/lib}/pairingheap.h +1 -1
  170. data/ext/pg_query/include/{lib → postgres/lib}/simplehash.h +9 -9
  171. data/ext/pg_query/include/{lib → postgres/lib}/sort_template.h +1 -1
  172. data/ext/pg_query/include/{lib → postgres/lib}/stringinfo.h +3 -3
  173. data/ext/pg_query/include/{libpq → postgres/libpq}/auth.h +8 -2
  174. data/ext/pg_query/include/{libpq → postgres/libpq}/crypt.h +1 -1
  175. data/ext/pg_query/include/{libpq → postgres/libpq}/hba.h +24 -17
  176. data/ext/pg_query/include/{libpq → postgres/libpq}/libpq-be.h +36 -25
  177. data/ext/pg_query/include/{libpq → postgres/libpq}/libpq.h +1 -1
  178. data/ext/pg_query/include/{libpq → postgres/libpq}/pqcomm.h +10 -41
  179. data/ext/pg_query/include/{libpq → postgres/libpq}/pqformat.h +2 -2
  180. data/ext/pg_query/include/{libpq → postgres/libpq}/pqsignal.h +22 -10
  181. data/ext/pg_query/include/postgres/libpq/sasl.h +136 -0
  182. data/ext/pg_query/include/postgres/libpq/scram.h +37 -0
  183. data/ext/pg_query/include/{mb → postgres/mb}/pg_wchar.h +35 -18
  184. data/ext/pg_query/include/{mb → postgres/mb}/stringinfo_mb.h +1 -1
  185. data/ext/pg_query/include/{miscadmin.h → postgres/miscadmin.h} +27 -15
  186. data/ext/pg_query/include/{nodes → postgres/nodes}/bitmapset.h +11 -7
  187. data/ext/pg_query/include/{nodes → postgres/nodes}/execnodes.h +83 -30
  188. data/ext/pg_query/include/{nodes → postgres/nodes}/extensible.h +5 -3
  189. data/ext/pg_query/include/{nodes → postgres/nodes}/lockoptions.h +1 -1
  190. data/ext/pg_query/include/{nodes → postgres/nodes}/makefuncs.h +14 -2
  191. data/ext/pg_query/include/{nodes → postgres/nodes}/memnodes.h +7 -4
  192. data/ext/pg_query/include/postgres/nodes/miscnodes.h +56 -0
  193. data/ext/pg_query/include/{nodes → postgres/nodes}/nodeFuncs.h +89 -29
  194. data/ext/pg_query/include/{nodes → postgres/nodes}/nodes.h +96 -511
  195. data/ext/pg_query/include/postgres/nodes/nodetags.h +471 -0
  196. data/ext/pg_query/include/{nodes → postgres/nodes}/params.h +3 -3
  197. data/ext/pg_query/include/{nodes → postgres/nodes}/parsenodes.h +377 -139
  198. data/ext/pg_query/include/{nodes → postgres/nodes}/pathnodes.h +1090 -440
  199. data/ext/pg_query/include/{nodes → postgres/nodes}/pg_list.h +30 -7
  200. data/ext/pg_query/include/{nodes → postgres/nodes}/plannodes.h +367 -124
  201. data/ext/pg_query/include/{nodes → postgres/nodes}/primnodes.h +670 -222
  202. data/ext/pg_query/include/{nodes → postgres/nodes}/print.h +1 -1
  203. data/ext/pg_query/include/{utils → postgres/nodes}/queryjumble.h +5 -7
  204. data/ext/pg_query/include/postgres/nodes/replnodes.h +111 -0
  205. data/ext/pg_query/include/postgres/nodes/supportnodes.h +346 -0
  206. data/ext/pg_query/include/{nodes → postgres/nodes}/tidbitmap.h +1 -1
  207. data/ext/pg_query/include/{nodes → postgres/nodes}/value.h +12 -2
  208. data/ext/pg_query/include/{optimizer → postgres/optimizer}/cost.h +6 -4
  209. data/ext/pg_query/include/{optimizer → postgres/optimizer}/geqo.h +1 -1
  210. data/ext/pg_query/include/{optimizer → postgres/optimizer}/geqo_gene.h +1 -1
  211. data/ext/pg_query/include/{optimizer → postgres/optimizer}/optimizer.h +8 -8
  212. data/ext/pg_query/include/{optimizer → postgres/optimizer}/paths.h +16 -7
  213. data/ext/pg_query/include/{optimizer → postgres/optimizer}/planmain.h +3 -6
  214. data/ext/pg_query/include/{parser → postgres/parser}/analyze.h +4 -3
  215. data/ext/pg_query/include/{parser → postgres/parser}/kwlist.h +12 -1
  216. data/ext/pg_query/include/{parser → postgres/parser}/parse_agg.h +4 -2
  217. data/ext/pg_query/include/{parser → postgres/parser}/parse_coerce.h +3 -1
  218. data/ext/pg_query/include/{parser → postgres/parser}/parse_expr.h +1 -1
  219. data/ext/pg_query/include/{parser → postgres/parser}/parse_func.h +1 -1
  220. data/ext/pg_query/include/{parser → postgres/parser}/parse_node.h +22 -4
  221. data/ext/pg_query/include/{parser → postgres/parser}/parse_oper.h +3 -3
  222. data/ext/pg_query/include/{parser → postgres/parser}/parse_relation.h +8 -3
  223. data/ext/pg_query/include/{parser → postgres/parser}/parse_type.h +4 -3
  224. data/ext/pg_query/include/{parser → postgres/parser}/parser.h +4 -4
  225. data/ext/pg_query/include/{parser → postgres/parser}/parsetree.h +1 -1
  226. data/ext/pg_query/include/{parser → postgres/parser}/scanner.h +2 -2
  227. data/ext/pg_query/include/{parser → postgres/parser}/scansup.h +1 -1
  228. data/ext/pg_query/include/{partitioning → postgres/partitioning}/partdefs.h +1 -1
  229. data/ext/pg_query/include/{pg_config.h → postgres/pg_config.h} +158 -218
  230. data/ext/pg_query/include/{pg_config_manual.h → postgres/pg_config_manual.h} +8 -46
  231. data/ext/pg_query/include/postgres/pg_config_os.h +8 -0
  232. data/ext/pg_query/include/{pg_getopt.h → postgres/pg_getopt.h} +1 -1
  233. data/ext/pg_query/include/{pg_trace.h → postgres/pg_trace.h} +1 -1
  234. data/ext/pg_query/include/{pgstat.h → postgres/pgstat.h} +173 -94
  235. data/ext/pg_query/include/{pgtime.h → postgres/pgtime.h} +3 -3
  236. data/ext/pg_query/include/{pl_gram.h → postgres/pl_gram.h} +66 -64
  237. data/ext/pg_query/include/{pl_reserved_kwlist.h → postgres/pl_reserved_kwlist.h} +1 -1
  238. data/ext/pg_query/include/{pl_reserved_kwlist_d.h → postgres/pl_reserved_kwlist_d.h} +1 -1
  239. data/ext/pg_query/include/{pl_unreserved_kwlist.h → postgres/pl_unreserved_kwlist.h} +2 -1
  240. data/ext/pg_query/include/{pl_unreserved_kwlist_d.h → postgres/pl_unreserved_kwlist_d.h} +48 -46
  241. data/ext/pg_query/include/{plpgsql.h → postgres/plpgsql.h} +28 -33
  242. data/ext/pg_query/include/{port → postgres/port}/atomics/arch-arm.h +3 -3
  243. data/ext/pg_query/include/postgres/port/atomics/arch-hppa.h +17 -0
  244. data/ext/pg_query/include/{port → postgres/port}/atomics/arch-ppc.h +21 -21
  245. data/ext/pg_query/include/{port → postgres/port}/atomics/arch-x86.h +2 -2
  246. data/ext/pg_query/include/{port → postgres/port}/atomics/fallback.h +3 -3
  247. data/ext/pg_query/include/{port → postgres/port}/atomics/generic-gcc.h +1 -1
  248. data/ext/pg_query/include/postgres/port/atomics/generic-msvc.h +101 -0
  249. data/ext/pg_query/include/postgres/port/atomics/generic-sunpro.h +106 -0
  250. data/ext/pg_query/include/{port → postgres/port}/atomics/generic.h +1 -1
  251. data/ext/pg_query/include/{port → postgres/port}/atomics.h +2 -7
  252. data/ext/pg_query/include/{port → postgres/port}/pg_bitutils.h +62 -25
  253. data/ext/pg_query/include/{port → postgres/port}/pg_bswap.h +1 -1
  254. data/ext/pg_query/include/{port → postgres/port}/pg_crc32c.h +1 -1
  255. data/ext/pg_query/include/postgres/port/simd.h +375 -0
  256. data/ext/pg_query/include/postgres/port/win32/arpa/inet.h +3 -0
  257. data/ext/pg_query/include/postgres/port/win32/dlfcn.h +1 -0
  258. data/ext/pg_query/include/postgres/port/win32/grp.h +1 -0
  259. data/ext/pg_query/include/postgres/port/win32/netdb.h +7 -0
  260. data/ext/pg_query/include/postgres/port/win32/netinet/in.h +3 -0
  261. data/ext/pg_query/include/postgres/port/win32/netinet/tcp.h +7 -0
  262. data/ext/pg_query/include/postgres/port/win32/pwd.h +3 -0
  263. data/ext/pg_query/include/postgres/port/win32/sys/resource.h +20 -0
  264. data/ext/pg_query/include/postgres/port/win32/sys/select.h +3 -0
  265. data/ext/pg_query/include/postgres/port/win32/sys/socket.h +26 -0
  266. data/ext/pg_query/include/postgres/port/win32/sys/un.h +17 -0
  267. data/ext/pg_query/include/postgres/port/win32/sys/wait.h +3 -0
  268. data/ext/pg_query/include/postgres/port/win32.h +59 -0
  269. data/ext/pg_query/include/postgres/port/win32_msvc/dirent.h +34 -0
  270. data/ext/pg_query/include/postgres/port/win32_msvc/sys/file.h +1 -0
  271. data/ext/pg_query/include/postgres/port/win32_msvc/sys/param.h +1 -0
  272. data/ext/pg_query/include/postgres/port/win32_msvc/sys/time.h +1 -0
  273. data/ext/pg_query/include/postgres/port/win32_msvc/unistd.h +9 -0
  274. data/ext/pg_query/include/postgres/port/win32_msvc/utime.h +3 -0
  275. data/ext/pg_query/include/postgres/port/win32_port.h +594 -0
  276. data/ext/pg_query/include/{port.h → postgres/port.h} +42 -75
  277. data/ext/pg_query/include/postgres/portability/instr_time.h +197 -0
  278. data/ext/pg_query/include/postgres/postgres.h +579 -0
  279. data/ext/pg_query/include/{postgres_ext.h → postgres/postgres_ext.h} +0 -1
  280. data/ext/pg_query/include/{postmaster → postgres/postmaster}/autovacuum.h +1 -4
  281. data/ext/pg_query/include/{postmaster → postgres/postmaster}/bgworker.h +2 -2
  282. data/ext/pg_query/include/{postmaster → postgres/postmaster}/bgworker_internals.h +1 -1
  283. data/ext/pg_query/include/{postmaster → postgres/postmaster}/bgwriter.h +2 -2
  284. data/ext/pg_query/include/{postmaster → postgres/postmaster}/interrupt.h +1 -1
  285. data/ext/pg_query/include/postgres/postmaster/pgarch.h +36 -0
  286. data/ext/pg_query/include/{postmaster → postgres/postmaster}/postmaster.h +6 -3
  287. data/ext/pg_query/include/{postmaster → postgres/postmaster}/startup.h +3 -1
  288. data/ext/pg_query/include/{postmaster → postgres/postmaster}/syslogger.h +2 -2
  289. data/ext/pg_query/include/{postmaster → postgres/postmaster}/walwriter.h +3 -1
  290. data/ext/pg_query/include/{regex → postgres/regex}/regex.h +9 -6
  291. data/ext/pg_query/include/{replication → postgres/replication}/logicallauncher.h +6 -1
  292. data/ext/pg_query/include/{replication → postgres/replication}/logicalproto.h +30 -10
  293. data/ext/pg_query/include/postgres/replication/logicalworker.h +32 -0
  294. data/ext/pg_query/include/{replication → postgres/replication}/origin.h +4 -4
  295. data/ext/pg_query/include/{replication → postgres/replication}/reorderbuffer.h +113 -45
  296. data/ext/pg_query/include/{replication → postgres/replication}/slot.h +25 -6
  297. data/ext/pg_query/include/{replication → postgres/replication}/syncrep.h +2 -8
  298. data/ext/pg_query/include/{replication → postgres/replication}/walreceiver.h +15 -9
  299. data/ext/pg_query/include/{replication → postgres/replication}/walsender.h +13 -13
  300. data/ext/pg_query/include/{rewrite → postgres/rewrite}/prs2lock.h +1 -1
  301. data/ext/pg_query/include/{rewrite → postgres/rewrite}/rewriteHandler.h +1 -4
  302. data/ext/pg_query/include/{rewrite → postgres/rewrite}/rewriteManip.h +11 -2
  303. data/ext/pg_query/include/{rewrite → postgres/rewrite}/rewriteSupport.h +1 -1
  304. data/ext/pg_query/include/{storage → postgres/storage}/backendid.h +1 -1
  305. data/ext/pg_query/include/{storage → postgres/storage}/block.h +24 -31
  306. data/ext/pg_query/include/{storage → postgres/storage}/buf.h +1 -1
  307. data/ext/pg_query/include/{storage → postgres/storage}/bufmgr.h +183 -87
  308. data/ext/pg_query/include/{storage → postgres/storage}/bufpage.h +146 -93
  309. data/ext/pg_query/include/{storage → postgres/storage}/condition_variable.h +2 -2
  310. data/ext/pg_query/include/{storage → postgres/storage}/dsm.h +3 -6
  311. data/ext/pg_query/include/{storage → postgres/storage}/dsm_impl.h +4 -1
  312. data/ext/pg_query/include/{storage → postgres/storage}/fd.h +24 -20
  313. data/ext/pg_query/include/{storage → postgres/storage}/fileset.h +1 -1
  314. data/ext/pg_query/include/{storage → postgres/storage}/ipc.h +2 -2
  315. data/ext/pg_query/include/{storage → postgres/storage}/item.h +1 -1
  316. data/ext/pg_query/include/{storage → postgres/storage}/itemid.h +1 -1
  317. data/ext/pg_query/include/{storage → postgres/storage}/itemptr.h +94 -57
  318. data/ext/pg_query/include/{storage → postgres/storage}/large_object.h +1 -1
  319. data/ext/pg_query/include/{storage → postgres/storage}/latch.h +9 -1
  320. data/ext/pg_query/include/{storage → postgres/storage}/lmgr.h +6 -1
  321. data/ext/pg_query/include/{storage → postgres/storage}/lock.h +21 -13
  322. data/ext/pg_query/include/{storage → postgres/storage}/lockdefs.h +3 -3
  323. data/ext/pg_query/include/{storage → postgres/storage}/lwlock.h +16 -2
  324. data/ext/pg_query/include/{storage → postgres/storage}/off.h +1 -1
  325. data/ext/pg_query/include/{storage → postgres/storage}/pg_sema.h +1 -1
  326. data/ext/pg_query/include/{storage → postgres/storage}/pg_shmem.h +1 -1
  327. data/ext/pg_query/include/{storage → postgres/storage}/pmsignal.h +1 -1
  328. data/ext/pg_query/include/{storage → postgres/storage}/predicate.h +2 -2
  329. data/ext/pg_query/include/{storage → postgres/storage}/proc.h +22 -17
  330. data/ext/pg_query/include/{storage → postgres/storage}/procarray.h +3 -2
  331. data/ext/pg_query/include/{storage → postgres/storage}/proclist_types.h +1 -1
  332. data/ext/pg_query/include/{storage → postgres/storage}/procsignal.h +3 -1
  333. data/ext/pg_query/include/postgres/storage/relfilelocator.h +99 -0
  334. data/ext/pg_query/include/{storage → postgres/storage}/s_lock.h +66 -309
  335. data/ext/pg_query/include/{storage → postgres/storage}/sharedfileset.h +1 -1
  336. data/ext/pg_query/include/{storage → postgres/storage}/shm_mq.h +1 -1
  337. data/ext/pg_query/include/{storage → postgres/storage}/shm_toc.h +1 -1
  338. data/ext/pg_query/include/{storage → postgres/storage}/shmem.h +1 -23
  339. data/ext/pg_query/include/{storage → postgres/storage}/sinval.h +3 -3
  340. data/ext/pg_query/include/{storage → postgres/storage}/sinvaladt.h +4 -2
  341. data/ext/pg_query/include/{storage → postgres/storage}/smgr.h +12 -10
  342. data/ext/pg_query/include/{storage → postgres/storage}/spin.h +1 -1
  343. data/ext/pg_query/include/{storage → postgres/storage}/standby.h +9 -8
  344. data/ext/pg_query/include/{storage → postgres/storage}/standbydefs.h +1 -1
  345. data/ext/pg_query/include/{storage → postgres/storage}/sync.h +3 -3
  346. data/ext/pg_query/include/{tcop → postgres/tcop}/cmdtag.h +7 -2
  347. data/ext/pg_query/include/{tcop → postgres/tcop}/cmdtaglist.h +1 -1
  348. data/ext/pg_query/include/{tcop → postgres/tcop}/deparse_utility.h +1 -1
  349. data/ext/pg_query/include/{tcop → postgres/tcop}/dest.h +1 -3
  350. data/ext/pg_query/include/{tcop → postgres/tcop}/fastpath.h +1 -1
  351. data/ext/pg_query/include/{tcop → postgres/tcop}/pquery.h +1 -1
  352. data/ext/pg_query/include/{tcop → postgres/tcop}/tcopprot.h +3 -6
  353. data/ext/pg_query/include/{tcop → postgres/tcop}/utility.h +1 -1
  354. data/ext/pg_query/include/{tsearch → postgres/tsearch}/ts_cache.h +2 -4
  355. data/ext/pg_query/include/{utils → postgres/utils}/acl.h +26 -81
  356. data/ext/pg_query/include/{utils → postgres/utils}/aclchk_internal.h +1 -1
  357. data/ext/pg_query/include/{utils → postgres/utils}/array.h +19 -1
  358. data/ext/pg_query/include/{utils → postgres/utils}/backend_progress.h +2 -1
  359. data/ext/pg_query/include/{utils → postgres/utils}/backend_status.h +24 -3
  360. data/ext/pg_query/include/{utils → postgres/utils}/builtins.h +15 -6
  361. data/ext/pg_query/include/{utils → postgres/utils}/bytea.h +1 -1
  362. data/ext/pg_query/include/{utils → postgres/utils}/catcache.h +1 -1
  363. data/ext/pg_query/include/{utils → postgres/utils}/date.h +37 -9
  364. data/ext/pg_query/include/{utils → postgres/utils}/datetime.h +41 -21
  365. data/ext/pg_query/include/{utils → postgres/utils}/datum.h +1 -1
  366. data/ext/pg_query/include/{utils → postgres/utils}/dsa.h +5 -1
  367. data/ext/pg_query/include/{utils → postgres/utils}/elog.h +104 -29
  368. data/ext/pg_query/include/{utils → postgres/utils}/expandeddatum.h +14 -3
  369. data/ext/pg_query/include/{utils → postgres/utils}/expandedrecord.h +14 -4
  370. data/ext/pg_query/include/{utils → postgres/utils}/float.h +7 -6
  371. data/ext/pg_query/include/{utils → postgres/utils}/fmgroids.h +54 -1
  372. data/ext/pg_query/include/{utils → postgres/utils}/fmgrprotos.h +45 -3
  373. data/ext/pg_query/include/{utils → postgres/utils}/fmgrtab.h +1 -1
  374. data/ext/pg_query/include/{utils → postgres/utils}/guc.h +59 -86
  375. data/ext/pg_query/include/postgres/utils/guc_hooks.h +163 -0
  376. data/ext/pg_query/include/{utils → postgres/utils}/guc_tables.h +49 -3
  377. data/ext/pg_query/include/{utils → postgres/utils}/hsearch.h +1 -1
  378. data/ext/pg_query/include/{utils → postgres/utils}/inval.h +3 -3
  379. data/ext/pg_query/include/postgres/utils/logtape.h +77 -0
  380. data/ext/pg_query/include/{utils → postgres/utils}/lsyscache.h +5 -1
  381. data/ext/pg_query/include/{utils → postgres/utils}/memdebug.h +1 -1
  382. data/ext/pg_query/include/{utils → postgres/utils}/memutils.h +7 -51
  383. data/ext/pg_query/include/postgres/utils/memutils_internal.h +136 -0
  384. data/ext/pg_query/include/postgres/utils/memutils_memorychunk.h +237 -0
  385. data/ext/pg_query/include/{utils → postgres/utils}/numeric.h +20 -5
  386. data/ext/pg_query/include/{utils → postgres/utils}/palloc.h +9 -2
  387. data/ext/pg_query/include/{utils → postgres/utils}/partcache.h +3 -2
  388. data/ext/pg_query/include/{utils → postgres/utils}/pg_locale.h +22 -14
  389. data/ext/pg_query/include/{utils → postgres/utils}/pgstat_internal.h +37 -7
  390. data/ext/pg_query/include/{utils → postgres/utils}/plancache.h +1 -1
  391. data/ext/pg_query/include/{utils → postgres/utils}/portal.h +1 -1
  392. data/ext/pg_query/include/{utils → postgres/utils}/probes.h +6 -6
  393. data/ext/pg_query/include/postgres/utils/ps_status.h +47 -0
  394. data/ext/pg_query/include/{utils → postgres/utils}/queryenvironment.h +1 -1
  395. data/ext/pg_query/include/{utils → postgres/utils}/regproc.h +3 -3
  396. data/ext/pg_query/include/{utils → postgres/utils}/rel.h +60 -43
  397. data/ext/pg_query/include/{utils → postgres/utils}/relcache.h +13 -8
  398. data/ext/pg_query/include/{utils → postgres/utils}/reltrigger.h +1 -1
  399. data/ext/pg_query/include/{utils → postgres/utils}/resowner.h +1 -1
  400. data/ext/pg_query/include/{utils → postgres/utils}/ruleutils.h +6 -1
  401. data/ext/pg_query/include/{utils → postgres/utils}/sharedtuplestore.h +1 -1
  402. data/ext/pg_query/include/{utils → postgres/utils}/snapmgr.h +4 -2
  403. data/ext/pg_query/include/{utils → postgres/utils}/snapshot.h +1 -1
  404. data/ext/pg_query/include/{utils → postgres/utils}/sortsupport.h +2 -2
  405. data/ext/pg_query/include/{utils → postgres/utils}/syscache.h +4 -1
  406. data/ext/pg_query/include/{utils → postgres/utils}/timeout.h +1 -1
  407. data/ext/pg_query/include/{utils → postgres/utils}/timestamp.h +41 -11
  408. data/ext/pg_query/include/{utils → postgres/utils}/tuplesort.h +189 -35
  409. data/ext/pg_query/include/{utils → postgres/utils}/tuplestore.h +1 -1
  410. data/ext/pg_query/include/{utils → postgres/utils}/typcache.h +1 -1
  411. data/ext/pg_query/include/{utils → postgres/utils}/varlena.h +13 -1
  412. data/ext/pg_query/include/{utils → postgres/utils}/wait_event.h +9 -4
  413. data/ext/pg_query/include/{utils → postgres/utils}/xml.h +15 -5
  414. data/ext/pg_query/include/{postgres.h → postgres/varatt.h} +7 -457
  415. data/ext/pg_query/include/protobuf/pg_query.pb-c.h +6186 -5585
  416. data/ext/pg_query/include/protobuf/pg_query.pb.h +112443 -91222
  417. data/ext/pg_query/pg_query.c +10 -1
  418. data/ext/pg_query/pg_query.pb-c.c +19755 -17757
  419. data/ext/pg_query/pg_query_deparse.c +1 -10635
  420. data/ext/pg_query/pg_query_fingerprint.c +12 -8
  421. data/ext/pg_query/pg_query_fingerprint.h +1 -1
  422. data/ext/pg_query/pg_query_internal.h +1 -1
  423. data/ext/pg_query/pg_query_json_plpgsql.c +1 -0
  424. data/ext/pg_query/pg_query_normalize.c +1 -1
  425. data/ext/pg_query/pg_query_outfuncs_json.c +6 -0
  426. data/ext/pg_query/pg_query_outfuncs_protobuf.c +3 -2
  427. data/ext/pg_query/pg_query_parse.c +47 -5
  428. data/ext/pg_query/pg_query_parse_plpgsql.c +7 -5
  429. data/ext/pg_query/pg_query_readfuncs_protobuf.c +1 -0
  430. data/ext/pg_query/pg_query_ruby.c +5 -0
  431. data/ext/pg_query/pg_query_ruby_freebsd.sym +2 -0
  432. data/ext/pg_query/pg_query_scan.c +1 -1
  433. data/ext/pg_query/pg_query_split.c +3 -3
  434. data/ext/pg_query/postgres_deparse.c +11067 -0
  435. data/ext/pg_query/postgres_deparse.h +9 -0
  436. data/ext/pg_query/src_backend_catalog_namespace.c +7 -2
  437. data/ext/pg_query/src_backend_catalog_pg_proc.c +1 -1
  438. data/ext/pg_query/src_backend_commands_define.c +1 -1
  439. data/ext/pg_query/src_backend_nodes_bitmapset.c +11 -70
  440. data/ext/pg_query/src_backend_nodes_copyfuncs.c +96 -6202
  441. data/ext/pg_query/src_backend_nodes_equalfuncs.c +95 -4068
  442. data/ext/pg_query/src_backend_nodes_extensible.c +6 -29
  443. data/ext/pg_query/src_backend_nodes_list.c +14 -2
  444. data/ext/pg_query/src_backend_nodes_makefuncs.c +95 -1
  445. data/ext/pg_query/src_backend_nodes_nodeFuncs.c +283 -132
  446. data/ext/pg_query/src_backend_nodes_nodes.c +38 -0
  447. data/ext/pg_query/src_backend_nodes_value.c +1 -1
  448. data/ext/pg_query/src_backend_parser_gram.c +33208 -31806
  449. data/ext/pg_query/src_backend_parser_parser.c +28 -2
  450. data/ext/pg_query/src_backend_parser_scan.c +4318 -3329
  451. data/ext/pg_query/src_backend_parser_scansup.c +1 -1
  452. data/ext/pg_query/src_backend_storage_ipc_ipc.c +1 -1
  453. data/ext/pg_query/src_backend_tcop_postgres.c +66 -87
  454. data/ext/pg_query/src_backend_utils_activity_pgstat_database.c +1 -1
  455. data/ext/pg_query/src_backend_utils_adt_datum.c +5 -7
  456. data/ext/pg_query/src_backend_utils_adt_expandeddatum.c +1 -1
  457. data/ext/pg_query/src_backend_utils_adt_format_type.c +1 -1
  458. data/ext/pg_query/src_backend_utils_adt_numutils.c +489 -0
  459. data/ext/pg_query/src_backend_utils_adt_ruleutils.c +79 -5
  460. data/ext/pg_query/src_backend_utils_error_assert.c +4 -7
  461. data/ext/pg_query/src_backend_utils_error_elog.c +371 -249
  462. data/ext/pg_query/src_backend_utils_fmgr_fmgr.c +33 -1
  463. data/ext/pg_query/src_backend_utils_init_globals.c +6 -3
  464. data/ext/pg_query/src_backend_utils_mb_mbutils.c +21 -67
  465. data/ext/pg_query/src_backend_utils_misc_guc_tables.c +492 -0
  466. data/ext/pg_query/src_backend_utils_mmgr_alignedalloc.c +163 -0
  467. data/ext/pg_query/src_backend_utils_mmgr_aset.c +449 -312
  468. data/ext/pg_query/src_backend_utils_mmgr_generation.c +1039 -0
  469. data/ext/pg_query/src_backend_utils_mmgr_mcxt.c +398 -49
  470. data/ext/pg_query/src_backend_utils_mmgr_slab.c +1021 -0
  471. data/ext/pg_query/src_common_encnames.c +4 -1
  472. data/ext/pg_query/src_common_hashfn.c +1 -1
  473. data/ext/pg_query/src_common_keywords.c +1 -1
  474. data/ext/pg_query/src_common_kwlist_d.h +534 -510
  475. data/ext/pg_query/src_common_kwlookup.c +1 -1
  476. data/ext/pg_query/src_common_psprintf.c +1 -1
  477. data/ext/pg_query/src_common_stringinfo.c +4 -4
  478. data/ext/pg_query/src_common_wchar.c +9 -8
  479. data/ext/pg_query/src_pl_plpgsql_src_pl_comp.c +1 -1
  480. data/ext/pg_query/src_pl_plpgsql_src_pl_funcs.c +3 -1
  481. data/ext/pg_query/src_pl_plpgsql_src_pl_gram.c +661 -694
  482. data/ext/pg_query/src_pl_plpgsql_src_pl_handler.c +1 -1
  483. data/ext/pg_query/src_pl_plpgsql_src_pl_reserved_kwlist_d.h +1 -1
  484. data/ext/pg_query/src_pl_plpgsql_src_pl_scanner.c +1 -1
  485. data/ext/pg_query/src_pl_plpgsql_src_pl_unreserved_kwlist_d.h +48 -46
  486. data/ext/pg_query/src_port_pg_bitutils.c +79 -5
  487. data/ext/pg_query/src_port_pgstrcasecmp.c +29 -1
  488. data/ext/pg_query/src_port_snprintf.c +6 -10
  489. data/ext/pg_query/src_port_strerror.c +1 -1
  490. data/ext/pg_query/src_port_strlcpy.c +79 -0
  491. data/lib/pg_query/fingerprint.rb +2 -3
  492. data/lib/pg_query/node.rb +16 -11
  493. data/lib/pg_query/parse.rb +1 -1
  494. data/lib/pg_query/pg_query_pb.rb +166 -3191
  495. data/lib/pg_query/treewalker.rb +23 -5
  496. data/lib/pg_query/version.rb +1 -1
  497. metadata +432 -380
  498. data/ext/pg_query/guc-file.c +0 -0
  499. data/ext/pg_query/include/catalog/pg_parameter_acl.h +0 -60
  500. data/ext/pg_query/include/catalog/pg_parameter_acl_d.h +0 -34
  501. data/ext/pg_query/include/commands/variable.h +0 -38
  502. data/ext/pg_query/include/common/ip.h +0 -31
  503. data/ext/pg_query/include/getaddrinfo.h +0 -162
  504. data/ext/pg_query/include/kwlist_d.h +0 -1095
  505. data/ext/pg_query/include/parser/gram.h +0 -1101
  506. data/ext/pg_query/include/pg_config_os.h +0 -8
  507. data/ext/pg_query/include/portability/instr_time.h +0 -256
  508. data/ext/pg_query/include/postmaster/auxprocess.h +0 -20
  509. data/ext/pg_query/include/postmaster/fork_process.h +0 -17
  510. data/ext/pg_query/include/postmaster/pgarch.h +0 -73
  511. data/ext/pg_query/include/replication/logicalworker.h +0 -19
  512. data/ext/pg_query/include/storage/relfilenode.h +0 -99
  513. data/ext/pg_query/include/utils/dynahash.h +0 -20
  514. data/ext/pg_query/include/utils/pg_lsn.h +0 -29
  515. data/ext/pg_query/include/utils/pidfile.h +0 -56
  516. data/ext/pg_query/include/utils/ps_status.h +0 -25
  517. data/ext/pg_query/include/utils/rls.h +0 -50
  518. data/ext/pg_query/include/utils/tzparser.h +0 -39
  519. data/ext/pg_query/src_backend_postmaster_postmaster.c +0 -2201
  520. data/ext/pg_query/src_backend_storage_lmgr_s_lock.c +0 -371
  521. data/ext/pg_query/src_backend_utils_hash_dynahash.c +0 -1116
  522. data/ext/pg_query/src_backend_utils_misc_guc.c +0 -1993
  523. data/ext/pg_query/src_common_pg_prng.c +0 -152
  524. data/ext/pg_query/src_common_string.c +0 -92
  525. data/ext/pg_query/src_port_pgsleep.c +0 -69
  526. data/ext/pg_query/src_port_strnlen.c +0 -39
  527. /data/ext/pg_query/include/{access → postgres/access}/rmgr.h +0 -0
  528. /data/ext/pg_query/include/{pg_config_ext.h → postgres/pg_config_ext.h} +0 -0
  529. /data/ext/pg_query/include/{plerrcodes.h → postgres/plerrcodes.h} +0 -0
  530. /data/ext/pg_query/include/{storage → postgres/storage}/lwlocknames.h +0 -0
  531. /data/ext/pg_query/include/{utils → postgres/utils}/errcodes.h +0 -0
@@ -7,7 +7,7 @@
7
7
  * and join trees.
8
8
  *
9
9
  *
10
- * Portions Copyright (c) 1996-2022, PostgreSQL Global Development Group
10
+ * Portions Copyright (c) 1996-2023, 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
@@ -63,14 +63,27 @@ typedef enum OnCommitAction
63
63
  typedef struct RangeVar
64
64
  {
65
65
  NodeTag type;
66
- char *catalogname; /* the catalog (database) name, or NULL */
67
- char *schemaname; /* the schema name, or NULL */
68
- char *relname; /* the relation/sequence name */
69
- bool inh; /* expand rel by inheritance? recursively act
70
- * on children? */
71
- char relpersistence; /* see RELPERSISTENCE_* in pg_class.h */
72
- Alias *alias; /* table alias & optional column aliases */
73
- int location; /* token location, or -1 if unknown */
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;
74
87
  } RangeVar;
75
88
 
76
89
  /*
@@ -82,19 +95,32 @@ typedef struct RangeVar
82
95
  typedef struct TableFunc
83
96
  {
84
97
  NodeTag type;
85
- List *ns_uris; /* list of namespace URI expressions */
86
- List *ns_names; /* list of namespace names or NULL */
87
- Node *docexpr; /* input document expression */
88
- Node *rowexpr; /* row filter expression */
89
- List *colnames; /* column names (list of String) */
90
- List *coltypes; /* OID list of column type OIDs */
91
- List *coltypmods; /* integer list of column typmods */
92
- List *colcollations; /* OID list of column collation OIDs */
93
- List *colexprs; /* list of column filter expressions */
94
- List *coldefexprs; /* list of column default expressions */
95
- Bitmapset *notnulls; /* nullability flag for each output column */
96
- int ordinalitycol; /* counts from 0; -1 if none specified */
97
- int location; /* token location, or -1 if unknown */
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;
98
124
  } TableFunc;
99
125
 
100
126
  /*
@@ -102,8 +128,10 @@ typedef struct TableFunc
102
128
  * CREATE MATERIALIZED VIEW
103
129
  *
104
130
  * For CREATE MATERIALIZED VIEW, viewQuery is the parsed-but-not-rewritten
105
- * SELECT Query for the view; otherwise it's NULL. (Although it's actually
106
- * Query*, we declare it as Node* to avoid a forward reference.)
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.)
107
135
  */
108
136
  typedef struct IntoClause
109
137
  {
@@ -115,7 +143,8 @@ typedef struct IntoClause
115
143
  List *options; /* options from WITH clause */
116
144
  OnCommitAction onCommit; /* what do we do at COMMIT? */
117
145
  char *tableSpaceName; /* table space to use, or NULL */
118
- Node *viewQuery; /* materialized view's SELECT query */
146
+ /* materialized view's SELECT query */
147
+ Node *viewQuery pg_node_attr(query_jumble_ignore);
119
148
  bool skipData; /* true for WITH NO DATA */
120
149
  } IntoClause;
121
150
 
@@ -135,6 +164,8 @@ typedef struct IntoClause
135
164
  */
136
165
  typedef struct Expr
137
166
  {
167
+ pg_node_attr(abstract)
168
+
138
169
  NodeTag type;
139
170
  } Expr;
140
171
 
@@ -162,6 +193,14 @@ typedef struct Expr
162
193
  * row identity information during UPDATE/DELETE/MERGE. This value should
163
194
  * never be seen outside the planner.
164
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
+ *
165
204
  * In the parser, varnosyn and varattnosyn are either identical to
166
205
  * varno/varattno, or they specify the column's position in an aliased JOIN
167
206
  * RTE that hides the semantic referent RTE's refname. This is a syntactic
@@ -186,19 +225,50 @@ typedef struct Expr
186
225
  typedef struct Var
187
226
  {
188
227
  Expr xpr;
189
- int varno; /* index of this var's relation in the range
190
- * table, or INNER_VAR/OUTER_VAR/etc */
191
- AttrNumber varattno; /* attribute number of this var, or zero for
192
- * all attrs ("whole-row Var") */
193
- Oid vartype; /* pg_type OID for the type of this var */
194
- int32 vartypmod; /* pg_attribute typmod value */
195
- Oid varcollid; /* OID of collation, or InvalidOid if none */
196
- Index varlevelsup; /* for subquery variables referencing outer
197
- * relations; 0 in a normal var, >0 means N
198
- * levels up */
199
- Index varnosyn; /* syntactic relation index (0 if unknown) */
200
- AttrNumber varattnosyn; /* syntactic attribute number */
201
- int location; /* token location, or -1 if unknown */
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;
202
272
  } Var;
203
273
 
204
274
  /*
@@ -208,22 +278,39 @@ typedef struct Var
208
278
  * must be in non-extended form (4-byte header, no compression or external
209
279
  * references). This ensures that the Const node is self-contained and makes
210
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.
211
283
  */
212
284
  typedef struct Const
213
285
  {
286
+ pg_node_attr(custom_copy_equal, custom_read_write)
287
+
214
288
  Expr xpr;
215
- Oid consttype; /* pg_type OID of the constant's datatype */
216
- int32 consttypmod; /* typmod value, if any */
217
- Oid constcollid; /* OID of collation, or InvalidOid if none */
218
- int constlen; /* typlen of the constant's datatype */
219
- Datum constvalue; /* the constant's value */
220
- bool constisnull; /* whether the constant is null (if true,
221
- * constvalue is undefined) */
222
- bool constbyval; /* whether this datatype is passed by value.
223
- * If true, then all the information is stored
224
- * in the Datum. If false, then the Datum
225
- * contains a pointer to the information. */
226
- int location; /* token location, or -1 if unknown */
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);
227
314
  } Const;
228
315
 
229
316
  /*
@@ -267,9 +354,12 @@ typedef struct Param
267
354
  ParamKind paramkind; /* kind of parameter. See above */
268
355
  int paramid; /* numeric ID for parameter */
269
356
  Oid paramtype; /* pg_type OID of parameter's datatype */
270
- int32 paramtypmod; /* typmod value, if known */
271
- Oid paramcollid; /* OID of collation, or InvalidOid if none */
272
- int location; /* token location, or -1 if unknown */
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;
273
363
  } Param;
274
364
 
275
365
  /*
@@ -304,6 +394,10 @@ typedef struct Param
304
394
  * replaced with a single argument representing the partial-aggregate
305
395
  * transition values.
306
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
+ *
307
401
  * aggsplit indicates the expected partial-aggregation mode for the Aggref's
308
402
  * parent plan node. It's always set to AGGSPLIT_SIMPLE in the parser, but
309
403
  * the planner might change it to something else. We use this mainly as
@@ -316,30 +410,79 @@ typedef struct Param
316
410
  * and can share the result. Aggregates with same 'transno' but different
317
411
  * 'aggno' can share the same transition state, only the final function needs
318
412
  * to be called separately.
413
+ *
414
+ * Information related to collations, transition types and internal states
415
+ * are irrelevant for the query jumbling.
319
416
  */
320
417
  typedef struct Aggref
321
418
  {
322
419
  Expr xpr;
323
- Oid aggfnoid; /* pg_proc Oid of the aggregate */
324
- Oid aggtype; /* type Oid of result of the aggregate */
325
- Oid aggcollid; /* OID of collation of result */
326
- Oid inputcollid; /* OID of collation that function should use */
327
- Oid aggtranstype; /* type Oid of aggregate's transition value */
328
- List *aggargtypes; /* type Oids of direct and aggregated args */
329
- List *aggdirectargs; /* direct arguments, if an ordered-set agg */
330
- List *args; /* aggregated arguments and sort expressions */
331
- List *aggorder; /* ORDER BY (list of SortGroupClause) */
332
- List *aggdistinct; /* DISTINCT (list of SortGroupClause) */
333
- Expr *aggfilter; /* FILTER expression, if any */
334
- bool aggstar; /* true if argument list was really '*' */
335
- bool aggvariadic; /* true if variadic arguments have been
336
- * combined into an array last argument */
337
- char aggkind; /* aggregate kind (see pg_aggregate.h) */
338
- Index agglevelsup; /* > 0 if agg belongs to outer query */
339
- AggSplit aggsplit; /* expected agg-splitting mode of parent Agg */
340
- int aggno; /* unique ID within the Agg node */
341
- int aggtransno; /* unique ID of transition state in the Agg */
342
- int location; /* token location, or -1 if unknown */
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;
343
486
  } Aggref;
344
487
 
345
488
  /*
@@ -365,34 +508,59 @@ typedef struct Aggref
365
508
  *
366
509
  * In raw parse output we have only the args list; parse analysis fills in the
367
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.
368
514
  */
369
515
  typedef struct GroupingFunc
370
516
  {
371
517
  Expr xpr;
372
- List *args; /* arguments, not evaluated but kept for
373
- * benefit of EXPLAIN etc. */
374
- List *refs; /* ressortgrouprefs of arguments */
375
- List *cols; /* actual column positions set by planner */
376
- Index agglevelsup; /* same as Aggref.agglevelsup */
377
- int location; /* token location */
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;
378
533
  } GroupingFunc;
379
534
 
380
535
  /*
381
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".
382
540
  */
383
541
  typedef struct WindowFunc
384
542
  {
385
543
  Expr xpr;
386
- Oid winfnoid; /* pg_proc Oid of the function */
387
- Oid wintype; /* type Oid of result of the window function */
388
- Oid wincollid; /* OID of collation of result */
389
- Oid inputcollid; /* OID of collation that function should use */
390
- List *args; /* arguments to the window function */
391
- Expr *aggfilter; /* FILTER expression, if any */
392
- Index winref; /* index of associated WindowClause */
393
- bool winstar; /* true if argument list was really '*' */
394
- bool winagg; /* is function a simple aggregate? */
395
- int location; /* token location, or -1 if unknown */
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;
396
564
  } WindowFunc;
397
565
 
398
566
  /*
@@ -429,6 +597,8 @@ typedef struct WindowFunc
429
597
  * subscripting logic. Likewise, reftypmod and refcollid will match the
430
598
  * container's properties in a store, but could be different in a fetch.
431
599
  *
600
+ * Any internal state data is ignored for the query jumbling.
601
+ *
432
602
  * Note: for the cases where a container is returned, if refexpr yields a R/W
433
603
  * expanded container, then the implementation is allowed to modify that
434
604
  * object in-place and return the same object.
@@ -436,20 +606,28 @@ typedef struct WindowFunc
436
606
  typedef struct SubscriptingRef
437
607
  {
438
608
  Expr xpr;
439
- Oid refcontainertype; /* type of the container proper */
440
- Oid refelemtype; /* the container type's pg_type.typelem */
441
- Oid refrestype; /* type of the SubscriptingRef's result */
442
- int32 reftypmod; /* typmod of the result */
443
- Oid refcollid; /* collation of result, or InvalidOid if none */
444
- List *refupperindexpr; /* expressions that evaluate to upper
445
- * container indexes */
446
- List *reflowerindexpr; /* expressions that evaluate to lower
447
- * container indexes, or NIL for single
448
- * container element */
449
- Expr *refexpr; /* the expression that evaluates to a
450
- * container value */
451
- Expr *refassgnexpr; /* expression for the source value, or NULL if
452
- * fetch */
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;
453
631
  } SubscriptingRef;
454
632
 
455
633
  /*
@@ -488,20 +666,35 @@ typedef enum CoercionForm
488
666
 
489
667
  /*
490
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.
491
672
  */
492
673
  typedef struct FuncExpr
493
674
  {
494
675
  Expr xpr;
495
- Oid funcid; /* PG_PROC OID of the function */
496
- Oid funcresulttype; /* PG_TYPE OID of result value */
497
- bool funcretset; /* true if function returns set */
498
- bool funcvariadic; /* true if variadic arguments have been
499
- * combined into an array last argument */
500
- CoercionForm funcformat; /* how to display this function call */
501
- Oid funccollid; /* OID of collation of result */
502
- Oid inputcollid; /* OID of collation that function should use */
503
- List *args; /* arguments to the function */
504
- int location; /* token location, or -1 if unknown */
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;
505
698
  } FuncExpr;
506
699
 
507
700
  /*
@@ -521,10 +714,14 @@ typedef struct FuncExpr
521
714
  typedef struct NamedArgExpr
522
715
  {
523
716
  Expr xpr;
524
- Expr *arg; /* the argument expression */
525
- char *name; /* the name */
526
- int argnumber; /* argument's number in positional notation */
527
- int location; /* argument name location, or -1 if unknown */
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;
528
725
  } NamedArgExpr;
529
726
 
530
727
  /*
@@ -535,18 +732,38 @@ typedef struct NamedArgExpr
535
732
  * Note that opfuncid is not necessarily filled in immediately on creation
536
733
  * of the node. The planner makes sure it is valid before passing the node
537
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.
538
739
  */
539
740
  typedef struct OpExpr
540
741
  {
541
742
  Expr xpr;
542
- Oid opno; /* PG_OPERATOR OID of the operator */
543
- Oid opfuncid; /* PG_PROC OID of underlying function */
544
- Oid opresulttype; /* PG_TYPE OID of result value */
545
- bool opretset; /* true if operator returns set */
546
- Oid opcollid; /* OID of collation of result */
547
- Oid inputcollid; /* OID of collation that operator should use */
548
- List *args; /* arguments to the operator (1 or 2) */
549
- int location; /* token location, or -1 if unknown */
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;
550
767
  } OpExpr;
551
768
 
552
769
  /*
@@ -592,19 +809,41 @@ typedef OpExpr NullIfExpr;
592
809
  * corresponding function and won't be used during execution. For
593
810
  * non-hashtable based NOT INs, negfuncid will be set to InvalidOid. See
594
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.
595
819
  */
596
820
  typedef struct ScalarArrayOpExpr
597
821
  {
598
822
  Expr xpr;
599
- Oid opno; /* PG_OPERATOR OID of the operator */
600
- Oid opfuncid; /* PG_PROC OID of comparison function */
601
- Oid hashfuncid; /* PG_PROC OID of hash func or InvalidOid */
602
- Oid negfuncid; /* PG_PROC OID of negator of opfuncid function
603
- * or InvalidOid. See above */
604
- bool useOr; /* true for ANY, false for ALL */
605
- Oid inputcollid; /* OID of collation that operator should use */
606
- List *args; /* the scalar and array operands */
607
- int location; /* token location, or -1 if unknown */
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;
608
847
  } ScalarArrayOpExpr;
609
848
 
610
849
  /*
@@ -621,6 +860,8 @@ typedef enum BoolExprType
621
860
 
622
861
  typedef struct BoolExpr
623
862
  {
863
+ pg_node_attr(custom_read_write)
864
+
624
865
  Expr xpr;
625
866
  BoolExprType boolop;
626
867
  List *args; /* arguments to this expression */
@@ -697,8 +938,10 @@ typedef struct SubLink
697
938
  SubLinkType subLinkType; /* see above */
698
939
  int subLinkId; /* ID (1..n); 0 if not MULTIEXPR */
699
940
  Node *testexpr; /* outer-query test for ALL/ANY/ROWCOMPARE */
700
- List *operName; /* originally specified operator name */
701
- Node *subselect; /* subselect as Query* or raw parsetree */
941
+ /* originally specified operator name */
942
+ List *operName pg_node_attr(query_jumble_ignore);
943
+ /* subselect as Query* or raw parsetree */
944
+ Node *subselect;
702
945
  int location; /* token location, or -1 if unknown */
703
946
  } SubLink;
704
947
 
@@ -732,9 +975,9 @@ typedef struct SubLink
732
975
  * The values are assigned to the global PARAM_EXEC params indexed by parParam
733
976
  * (the parParam and args lists must have the same ordering). setParam is a
734
977
  * list of the PARAM_EXEC params that are computed by the sub-select, if it
735
- * is an initplan; they are listed in order by sub-select output column
736
- * position. (parParam and setParam are integer Lists, not Bitmapsets,
737
- * because their ordering is significant.)
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.)
738
981
  *
739
982
  * Also, the planner computes startup and per-call costs for use of the
740
983
  * SubPlan. Note that these include the cost of the subquery proper,
@@ -742,6 +985,8 @@ typedef struct SubLink
742
985
  */
743
986
  typedef struct SubPlan
744
987
  {
988
+ pg_node_attr(no_query_jumble)
989
+
745
990
  Expr xpr;
746
991
  /* Fields copied from original SubLink: */
747
992
  SubLinkType subLinkType; /* see above */
@@ -767,8 +1012,8 @@ typedef struct SubPlan
767
1012
  /* Note: parallel_safe does not consider contents of testexpr or args */
768
1013
  /* Information for passing params into and out of the subselect: */
769
1014
  /* setParam and parParam are lists of integers (param IDs) */
770
- List *setParam; /* initplan subqueries have to set these
771
- * Params for parent plan */
1015
+ List *setParam; /* initplan and MULTIEXPR subqueries have to
1016
+ * set these Params for parent plan */
772
1017
  List *parParam; /* indices of input Params from parent plan */
773
1018
  List *args; /* exprs to pass as parParam values */
774
1019
  /* Estimated execution costs: */
@@ -789,6 +1034,8 @@ typedef struct SubPlan
789
1034
  */
790
1035
  typedef struct AlternativeSubPlan
791
1036
  {
1037
+ pg_node_attr(no_query_jumble)
1038
+
792
1039
  Expr xpr;
793
1040
  List *subplans; /* SubPlan(s) with equivalent results */
794
1041
  } AlternativeSubPlan;
@@ -807,10 +1054,12 @@ typedef struct FieldSelect
807
1054
  Expr xpr;
808
1055
  Expr *arg; /* input expression */
809
1056
  AttrNumber fieldnum; /* attribute number of field to extract */
810
- Oid resulttype; /* type of the field (result type of this
811
- * node) */
812
- int32 resulttypmod; /* output typmod (usually -1) */
813
- Oid resultcollid; /* OID of collation of the field */
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);
814
1063
  } FieldSelect;
815
1064
 
816
1065
  /* ----------------
@@ -836,8 +1085,10 @@ typedef struct FieldStore
836
1085
  Expr xpr;
837
1086
  Expr *arg; /* input tuple value */
838
1087
  List *newvals; /* new value(s) for field(s) */
839
- List *fieldnums; /* integer list of field attnums */
840
- Oid resulttype; /* type of result (same as type of arg) */
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);
841
1092
  /* Like RowExpr, we deliberately omit a typmod and collation here */
842
1093
  } FieldStore;
843
1094
 
@@ -859,9 +1110,12 @@ typedef struct RelabelType
859
1110
  Expr xpr;
860
1111
  Expr *arg; /* input expression */
861
1112
  Oid resulttype; /* output type of coercion expression */
862
- int32 resulttypmod; /* output typmod (usually -1) */
863
- Oid resultcollid; /* OID of collation, or InvalidOid if none */
864
- CoercionForm relabelformat; /* how to display this node */
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);
865
1119
  int location; /* token location, or -1 if unknown */
866
1120
  } RelabelType;
867
1121
 
@@ -880,8 +1134,10 @@ typedef struct CoerceViaIO
880
1134
  Expr *arg; /* input expression */
881
1135
  Oid resulttype; /* output type of coercion */
882
1136
  /* output typmod is not stored, but is presumed -1 */
883
- Oid resultcollid; /* OID of collation, or InvalidOid if none */
884
- CoercionForm coerceformat; /* how to display this node */
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);
885
1141
  int location; /* token location, or -1 if unknown */
886
1142
  } CoerceViaIO;
887
1143
 
@@ -904,9 +1160,12 @@ typedef struct ArrayCoerceExpr
904
1160
  Expr *arg; /* input expression (yields an array) */
905
1161
  Expr *elemexpr; /* expression representing per-element work */
906
1162
  Oid resulttype; /* output type of coercion (an array type) */
907
- int32 resulttypmod; /* output typmod (also element typmod) */
908
- Oid resultcollid; /* OID of collation, or InvalidOid if none */
909
- CoercionForm coerceformat; /* how to display this node */
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);
910
1169
  int location; /* token location, or -1 if unknown */
911
1170
  } ArrayCoerceExpr;
912
1171
 
@@ -929,7 +1188,8 @@ typedef struct ConvertRowtypeExpr
929
1188
  Expr *arg; /* input expression */
930
1189
  Oid resulttype; /* output type (always a composite type) */
931
1190
  /* Like RowExpr, we deliberately omit a typmod and collation here */
932
- CoercionForm convertformat; /* how to display this node */
1191
+ /* how to display this node */
1192
+ CoercionForm convertformat pg_node_attr(query_jumble_ignore);
933
1193
  int location; /* token location, or -1 if unknown */
934
1194
  } ConvertRowtypeExpr;
935
1195
 
@@ -973,8 +1233,10 @@ typedef struct CollateExpr
973
1233
  typedef struct CaseExpr
974
1234
  {
975
1235
  Expr xpr;
976
- Oid casetype; /* type of expression result */
977
- Oid casecollid; /* OID of collation, or InvalidOid if none */
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);
978
1240
  Expr *arg; /* implicit equality comparison argument */
979
1241
  List *args; /* the arguments (list of WHEN clauses) */
980
1242
  Expr *defresult; /* the default result (ELSE clause) */
@@ -1002,6 +1264,8 @@ typedef struct CaseWhen
1002
1264
  * see build_coercion_expression().
1003
1265
  * * Nested FieldStore/SubscriptingRef assignment expressions in INSERT/UPDATE;
1004
1266
  * see transformAssignmentIndirection().
1267
+ * * Placeholder for intermediate results in some SQL/JSON expression nodes,
1268
+ * such as JsonConstructorExpr.
1005
1269
  *
1006
1270
  * The uses in CaseExpr and ArrayCoerceExpr are safe only to the extent that
1007
1271
  * there is not any other CaseExpr or ArrayCoerceExpr between the value source
@@ -1016,8 +1280,10 @@ typedef struct CaseTestExpr
1016
1280
  {
1017
1281
  Expr xpr;
1018
1282
  Oid typeId; /* type for substituted value */
1019
- int32 typeMod; /* typemod for substituted value */
1020
- Oid collation; /* collation for the 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);
1021
1287
  } CaseTestExpr;
1022
1288
 
1023
1289
  /*
@@ -1031,12 +1297,18 @@ typedef struct CaseTestExpr
1031
1297
  typedef struct ArrayExpr
1032
1298
  {
1033
1299
  Expr xpr;
1034
- Oid array_typeid; /* type of expression result */
1035
- Oid array_collid; /* OID of collation, or InvalidOid if none */
1036
- Oid element_typeid; /* common type of array elements */
1037
- List *elements; /* the array elements or sub-arrays */
1038
- bool multidims; /* true if elements are sub-arrays */
1039
- int location; /* token location, or -1 if unknown */
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;
1040
1312
  } ArrayExpr;
1041
1313
 
1042
1314
  /*
@@ -1064,7 +1336,9 @@ typedef struct RowExpr
1064
1336
  {
1065
1337
  Expr xpr;
1066
1338
  List *args; /* the fields */
1067
- Oid row_typeid; /* RECORDOID or a composite type's ID */
1339
+
1340
+ /* RECORDOID or a composite type's ID */
1341
+ Oid row_typeid pg_node_attr(query_jumble_ignore);
1068
1342
 
1069
1343
  /*
1070
1344
  * row_typeid cannot be a domain over composite, only plain composite. To
@@ -1078,8 +1352,13 @@ typedef struct RowExpr
1078
1352
  * We don't need to store a collation either. The result type is
1079
1353
  * necessarily composite, and composite types never have a collation.
1080
1354
  */
1081
- CoercionForm row_format; /* how to display this node */
1082
- List *colnames; /* list of String, or NIL */
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
+
1083
1362
  int location; /* token location, or -1 if unknown */
1084
1363
  } RowExpr;
1085
1364
 
@@ -1111,12 +1390,19 @@ typedef enum RowCompareType
1111
1390
  typedef struct RowCompareExpr
1112
1391
  {
1113
1392
  Expr xpr;
1114
- RowCompareType rctype; /* LT LE GE or GT, never EQ or NE */
1115
- List *opnos; /* OID list of pairwise comparison ops */
1116
- List *opfamilies; /* OID list of containing operator families */
1117
- List *inputcollids; /* OID list of collations for comparisons */
1118
- List *largs; /* the left-hand input arguments */
1119
- List *rargs; /* the right-hand input arguments */
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;
1120
1406
  } RowCompareExpr;
1121
1407
 
1122
1408
  /*
@@ -1125,10 +1411,14 @@ typedef struct RowCompareExpr
1125
1411
  typedef struct CoalesceExpr
1126
1412
  {
1127
1413
  Expr xpr;
1128
- Oid coalescetype; /* type of expression result */
1129
- Oid coalescecollid; /* OID of collation, or InvalidOid if none */
1130
- List *args; /* the arguments */
1131
- int location; /* token location, or -1 if unknown */
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;
1132
1422
  } CoalesceExpr;
1133
1423
 
1134
1424
  /*
@@ -1143,12 +1433,18 @@ typedef enum MinMaxOp
1143
1433
  typedef struct MinMaxExpr
1144
1434
  {
1145
1435
  Expr xpr;
1146
- Oid minmaxtype; /* common type of arguments and result */
1147
- Oid minmaxcollid; /* OID of collation of result */
1148
- Oid inputcollid; /* OID of collation that function should use */
1149
- MinMaxOp op; /* function to execute */
1150
- List *args; /* the arguments */
1151
- int location; /* token location, or -1 if unknown */
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;
1152
1448
  } MinMaxExpr;
1153
1449
 
1154
1450
  /*
@@ -1185,7 +1481,12 @@ typedef struct SQLValueFunction
1185
1481
  {
1186
1482
  Expr xpr;
1187
1483
  SQLValueFunctionOp op; /* which function this is */
1188
- Oid type; /* result type/typmod */
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);
1189
1490
  int32 typmod;
1190
1491
  int location; /* token location, or -1 if unknown */
1191
1492
  } SQLValueFunction;
@@ -1209,7 +1510,7 @@ typedef enum XmlExprOp
1209
1510
  IS_XMLPARSE, /* XMLPARSE(text, is_doc, preserve_ws) */
1210
1511
  IS_XMLPI, /* XMLPI(name [, args]) */
1211
1512
  IS_XMLROOT, /* XMLROOT(xml, version, standalone) */
1212
- IS_XMLSERIALIZE, /* XMLSERIALIZE(is_document, xmlval) */
1513
+ IS_XMLSERIALIZE, /* XMLSERIALIZE(is_document, xmlval, indent) */
1213
1514
  IS_DOCUMENT /* xmlval IS DOCUMENT */
1214
1515
  } XmlExprOp;
1215
1516
 
@@ -1222,17 +1523,142 @@ typedef enum XmlOptionType
1222
1523
  typedef struct XmlExpr
1223
1524
  {
1224
1525
  Expr xpr;
1225
- XmlExprOp op; /* xml function ID */
1226
- char *name; /* name in xml(NAME foo ...) syntaxes */
1227
- List *named_args; /* non-XML expressions for xml_attributes */
1228
- List *arg_names; /* parallel list of String values */
1229
- List *args; /* list of expressions */
1230
- XmlOptionType xmloption; /* DOCUMENT or CONTENT */
1231
- Oid type; /* target type/typmod for XMLSERIALIZE */
1232
- int32 typmod;
1233
- int location; /* token location, or -1 if unknown */
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;
1234
1545
  } XmlExpr;
1235
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
+
1236
1662
  /* ----------------
1237
1663
  * NullTest
1238
1664
  *
@@ -1262,7 +1688,8 @@ typedef struct NullTest
1262
1688
  Expr xpr;
1263
1689
  Expr *arg; /* input expression */
1264
1690
  NullTestType nulltesttype; /* IS NULL, IS NOT NULL */
1265
- bool argisrow; /* T to perform field-by-field null checks */
1691
+ /* T to perform field-by-field null checks */
1692
+ bool argisrow pg_node_attr(query_jumble_ignore);
1266
1693
  int location; /* token location, or -1 if unknown */
1267
1694
  } NullTest;
1268
1695
 
@@ -1302,9 +1729,12 @@ typedef struct CoerceToDomain
1302
1729
  Expr xpr;
1303
1730
  Expr *arg; /* input expression */
1304
1731
  Oid resulttype; /* domain type ID (result type) */
1305
- int32 resulttypmod; /* output typmod (currently always -1) */
1306
- Oid resultcollid; /* OID of collation, or InvalidOid if none */
1307
- CoercionForm coercionformat; /* how to display this node */
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);
1308
1738
  int location; /* token location, or -1 if unknown */
1309
1739
  } CoerceToDomain;
1310
1740
 
@@ -1320,10 +1750,14 @@ typedef struct CoerceToDomain
1320
1750
  typedef struct CoerceToDomainValue
1321
1751
  {
1322
1752
  Expr xpr;
1323
- Oid typeId; /* type for substituted value */
1324
- int32 typeMod; /* typemod for substituted value */
1325
- Oid collation; /* collation for the substituted value */
1326
- int location; /* token location, or -1 if unknown */
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;
1327
1761
  } CoerceToDomainValue;
1328
1762
 
1329
1763
  /*
@@ -1336,10 +1770,14 @@ typedef struct CoerceToDomainValue
1336
1770
  typedef struct SetToDefault
1337
1771
  {
1338
1772
  Expr xpr;
1339
- Oid typeId; /* type for substituted value */
1340
- int32 typeMod; /* typemod for substituted value */
1341
- Oid collation; /* collation for the substituted value */
1342
- int location; /* token location, or -1 if unknown */
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;
1343
1781
  } SetToDefault;
1344
1782
 
1345
1783
  /*
@@ -1450,15 +1888,20 @@ typedef struct InferenceElem
1450
1888
  typedef struct TargetEntry
1451
1889
  {
1452
1890
  Expr xpr;
1453
- Expr *expr; /* expression to evaluate */
1454
- AttrNumber resno; /* attribute number (see notes above) */
1455
- char *resname; /* name of the column (could be NULL) */
1456
- Index ressortgroupref; /* nonzero if referenced by a sort/group
1457
- * clause */
1458
- Oid resorigtbl; /* OID of column's source table */
1459
- AttrNumber resorigcol; /* column's number in source table */
1460
- bool resjunk; /* set to true to eliminate the attribute from
1461
- * final target list */
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);
1462
1905
  } TargetEntry;
1463
1906
 
1464
1907
 
@@ -1540,11 +1983,16 @@ typedef struct JoinExpr
1540
1983
  bool isNatural; /* Natural join? Will need to shape table */
1541
1984
  Node *larg; /* left subtree */
1542
1985
  Node *rarg; /* right subtree */
1543
- List *usingClause; /* USING clause, if any (list of String) */
1544
- Alias *join_using_alias; /* alias attached to USING clause, if any */
1545
- Node *quals; /* qualifiers on join, if any */
1546
- Alias *alias; /* user-written alias clause, if any */
1547
- int rtindex; /* RT index assigned for join, or 0 */
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;
1548
1996
  } JoinExpr;
1549
1997
 
1550
1998
  /*----------