pg_query 2.2.1 → 4.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (465) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +5 -0
  3. data/Rakefile +2 -2
  4. data/ext/pg_query/include/access/amapi.h +45 -1
  5. data/ext/pg_query/include/access/attmap.h +1 -1
  6. data/ext/pg_query/include/access/attnum.h +2 -2
  7. data/ext/pg_query/include/access/clog.h +4 -2
  8. data/ext/pg_query/include/access/commit_ts.h +6 -9
  9. data/ext/pg_query/include/access/detoast.h +1 -11
  10. data/ext/pg_query/include/access/genam.h +15 -12
  11. data/ext/pg_query/include/access/gin.h +2 -2
  12. data/ext/pg_query/include/access/htup.h +1 -1
  13. data/ext/pg_query/include/access/htup_details.h +75 -87
  14. data/ext/pg_query/include/access/itup.h +7 -1
  15. data/ext/pg_query/include/access/parallel.h +2 -2
  16. data/ext/pg_query/include/access/printtup.h +1 -1
  17. data/ext/pg_query/include/access/relation.h +1 -1
  18. data/ext/pg_query/include/access/relscan.h +17 -2
  19. data/ext/pg_query/include/access/rmgr.h +30 -3
  20. data/ext/pg_query/include/access/rmgrlist.h +23 -23
  21. data/ext/pg_query/include/access/sdir.h +1 -1
  22. data/ext/pg_query/include/access/skey.h +1 -1
  23. data/ext/pg_query/include/access/stratnum.h +4 -2
  24. data/ext/pg_query/include/access/sysattr.h +1 -1
  25. data/ext/pg_query/include/access/table.h +2 -1
  26. data/ext/pg_query/include/access/tableam.h +272 -20
  27. data/ext/pg_query/include/access/toast_compression.h +73 -0
  28. data/ext/pg_query/include/access/transam.h +123 -13
  29. data/ext/pg_query/include/access/tupconvert.h +1 -1
  30. data/ext/pg_query/include/access/tupdesc.h +1 -1
  31. data/ext/pg_query/include/access/tupmacs.h +3 -3
  32. data/ext/pg_query/include/access/twophase.h +3 -1
  33. data/ext/pg_query/include/access/xact.h +73 -19
  34. data/ext/pg_query/include/access/xlog.h +60 -155
  35. data/ext/pg_query/include/access/xlog_internal.h +40 -13
  36. data/ext/pg_query/include/access/xlogdefs.h +8 -16
  37. data/ext/pg_query/include/access/xlogprefetcher.h +55 -0
  38. data/ext/pg_query/include/access/xlogreader.h +145 -39
  39. data/ext/pg_query/include/access/xlogrecord.h +18 -9
  40. data/ext/pg_query/include/access/xlogrecovery.h +157 -0
  41. data/ext/pg_query/include/c.h +101 -44
  42. data/ext/pg_query/include/catalog/catalog.h +3 -1
  43. data/ext/pg_query/include/catalog/catversion.h +2 -2
  44. data/ext/pg_query/include/catalog/dependency.h +8 -16
  45. data/ext/pg_query/include/catalog/genbki.h +83 -5
  46. data/ext/pg_query/include/catalog/index.h +18 -3
  47. data/ext/pg_query/include/catalog/indexing.h +12 -324
  48. data/ext/pg_query/include/catalog/namespace.h +4 -2
  49. data/ext/pg_query/include/catalog/objectaccess.h +70 -2
  50. data/ext/pg_query/include/catalog/objectaddress.h +11 -6
  51. data/ext/pg_query/include/catalog/pg_aggregate.h +14 -10
  52. data/ext/pg_query/include/catalog/pg_aggregate_d.h +2 -1
  53. data/ext/pg_query/include/catalog/pg_am.h +4 -1
  54. data/ext/pg_query/include/catalog/pg_am_d.h +3 -1
  55. data/ext/pg_query/include/catalog/pg_attribute.h +27 -10
  56. data/ext/pg_query/include/catalog/pg_attribute_d.h +21 -18
  57. data/ext/pg_query/include/catalog/pg_authid.h +7 -2
  58. data/ext/pg_query/include/catalog/pg_authid_d.h +17 -9
  59. data/ext/pg_query/include/catalog/pg_class.h +44 -14
  60. data/ext/pg_query/include/catalog/pg_class_d.h +30 -1
  61. data/ext/pg_query/include/catalog/pg_collation.h +33 -8
  62. data/ext/pg_query/include/catalog/pg_collation_d.h +20 -3
  63. data/ext/pg_query/include/catalog/pg_constraint.h +38 -12
  64. data/ext/pg_query/include/catalog/pg_constraint_d.h +10 -4
  65. data/ext/pg_query/include/catalog/pg_control.h +3 -5
  66. data/ext/pg_query/include/catalog/pg_conversion.h +7 -4
  67. data/ext/pg_query/include/catalog/pg_conversion_d.h +4 -1
  68. data/ext/pg_query/include/catalog/pg_depend.h +11 -7
  69. data/ext/pg_query/include/catalog/pg_depend_d.h +3 -1
  70. data/ext/pg_query/include/catalog/pg_event_trigger.h +9 -3
  71. data/ext/pg_query/include/catalog/pg_event_trigger_d.h +3 -1
  72. data/ext/pg_query/include/catalog/pg_index.h +17 -7
  73. data/ext/pg_query/include/catalog/pg_index_d.h +20 -17
  74. data/ext/pg_query/include/catalog/pg_language.h +10 -5
  75. data/ext/pg_query/include/catalog/pg_language_d.h +3 -1
  76. data/ext/pg_query/include/catalog/pg_namespace.h +7 -2
  77. data/ext/pg_query/include/catalog/pg_namespace_d.h +3 -1
  78. data/ext/pg_query/include/catalog/pg_opclass.h +8 -5
  79. data/ext/pg_query/include/catalog/pg_opclass_d.h +3 -1
  80. data/ext/pg_query/include/catalog/pg_operator.h +18 -15
  81. data/ext/pg_query/include/catalog/pg_operator_d.h +37 -1
  82. data/ext/pg_query/include/catalog/pg_opfamily.h +6 -3
  83. data/ext/pg_query/include/catalog/pg_opfamily_d.h +3 -1
  84. data/ext/pg_query/include/catalog/pg_parameter_acl.h +60 -0
  85. data/ext/pg_query/include/catalog/pg_parameter_acl_d.h +34 -0
  86. data/ext/pg_query/include/catalog/pg_partitioned_table.h +20 -9
  87. data/ext/pg_query/include/catalog/pg_partitioned_table_d.h +2 -1
  88. data/ext/pg_query/include/catalog/pg_proc.h +20 -11
  89. data/ext/pg_query/include/catalog/pg_proc_d.h +10 -8
  90. data/ext/pg_query/include/catalog/pg_publication.h +50 -7
  91. data/ext/pg_query/include/catalog/pg_publication_d.h +3 -1
  92. data/ext/pg_query/include/catalog/pg_replication_origin.h +6 -1
  93. data/ext/pg_query/include/catalog/pg_replication_origin_d.h +5 -1
  94. data/ext/pg_query/include/catalog/pg_statistic.h +19 -12
  95. data/ext/pg_query/include/catalog/pg_statistic_d.h +2 -1
  96. data/ext/pg_query/include/catalog/pg_statistic_ext.h +19 -5
  97. data/ext/pg_query/include/catalog/pg_statistic_ext_d.h +7 -2
  98. data/ext/pg_query/include/catalog/pg_transform.h +8 -5
  99. data/ext/pg_query/include/catalog/pg_transform_d.h +3 -1
  100. data/ext/pg_query/include/catalog/pg_trigger.h +24 -8
  101. data/ext/pg_query/include/catalog/pg_trigger_d.h +4 -1
  102. data/ext/pg_query/include/catalog/pg_ts_config.h +6 -3
  103. data/ext/pg_query/include/catalog/pg_ts_config_d.h +3 -1
  104. data/ext/pg_query/include/catalog/pg_ts_dict.h +8 -3
  105. data/ext/pg_query/include/catalog/pg_ts_dict_d.h +3 -1
  106. data/ext/pg_query/include/catalog/pg_ts_parser.h +6 -3
  107. data/ext/pg_query/include/catalog/pg_ts_parser_d.h +3 -1
  108. data/ext/pg_query/include/catalog/pg_ts_template.h +6 -3
  109. data/ext/pg_query/include/catalog/pg_ts_template_d.h +3 -1
  110. data/ext/pg_query/include/catalog/pg_type.h +55 -24
  111. data/ext/pg_query/include/catalog/pg_type_d.h +70 -31
  112. data/ext/pg_query/include/catalog/storage.h +5 -3
  113. data/ext/pg_query/include/commands/async.h +3 -4
  114. data/ext/pg_query/include/commands/dbcommands.h +2 -1
  115. data/ext/pg_query/include/commands/defrem.h +11 -24
  116. data/ext/pg_query/include/commands/event_trigger.h +2 -2
  117. data/ext/pg_query/include/commands/explain.h +1 -1
  118. data/ext/pg_query/include/commands/prepare.h +1 -1
  119. data/ext/pg_query/include/commands/tablespace.h +2 -2
  120. data/ext/pg_query/include/commands/trigger.h +18 -16
  121. data/ext/pg_query/include/commands/user.h +2 -2
  122. data/ext/pg_query/include/commands/vacuum.h +88 -41
  123. data/ext/pg_query/include/commands/variable.h +1 -1
  124. data/ext/pg_query/include/common/file_perm.h +4 -4
  125. data/ext/pg_query/include/common/hashfn.h +1 -1
  126. data/ext/pg_query/include/common/ip.h +1 -7
  127. data/ext/pg_query/include/common/keywords.h +2 -6
  128. data/ext/pg_query/include/common/kwlookup.h +1 -1
  129. data/ext/pg_query/include/common/pg_prng.h +60 -0
  130. data/ext/pg_query/include/common/relpath.h +2 -2
  131. data/ext/pg_query/include/common/string.h +24 -1
  132. data/ext/pg_query/include/common/unicode_combining_table.h +114 -2
  133. data/ext/pg_query/include/common/unicode_east_asian_fw_table.h +125 -0
  134. data/ext/pg_query/include/datatype/timestamp.h +40 -1
  135. data/ext/pg_query/include/executor/execdesc.h +1 -1
  136. data/ext/pg_query/include/executor/executor.h +65 -22
  137. data/ext/pg_query/include/executor/functions.h +17 -3
  138. data/ext/pg_query/include/executor/instrument.h +33 -16
  139. data/ext/pg_query/include/executor/spi.h +41 -3
  140. data/ext/pg_query/include/executor/tablefunc.h +1 -1
  141. data/ext/pg_query/include/executor/tuptable.h +1 -1
  142. data/ext/pg_query/include/fmgr.h +13 -7
  143. data/ext/pg_query/include/funcapi.h +16 -4
  144. data/ext/pg_query/include/getaddrinfo.h +1 -1
  145. data/ext/pg_query/include/jit/jit.h +11 -11
  146. data/ext/pg_query/include/kwlist_d.h +517 -494
  147. data/ext/pg_query/include/lib/dshash.h +112 -0
  148. data/ext/pg_query/include/lib/ilist.h +20 -1
  149. data/ext/pg_query/include/lib/pairingheap.h +1 -1
  150. data/ext/pg_query/include/lib/simplehash.h +140 -15
  151. data/ext/pg_query/include/lib/sort_template.h +432 -0
  152. data/ext/pg_query/include/lib/stringinfo.h +1 -1
  153. data/ext/pg_query/include/libpq/auth.h +6 -4
  154. data/ext/pg_query/include/libpq/crypt.h +5 -4
  155. data/ext/pg_query/include/libpq/hba.h +43 -4
  156. data/ext/pg_query/include/libpq/libpq-be.h +23 -6
  157. data/ext/pg_query/include/libpq/libpq.h +30 -20
  158. data/ext/pg_query/include/libpq/pqcomm.h +17 -31
  159. data/ext/pg_query/include/libpq/pqformat.h +1 -1
  160. data/ext/pg_query/include/libpq/pqsignal.h +4 -4
  161. data/ext/pg_query/include/mb/pg_wchar.h +105 -23
  162. data/ext/pg_query/include/mb/stringinfo_mb.h +1 -1
  163. data/ext/pg_query/include/miscadmin.h +47 -41
  164. data/ext/pg_query/include/nodes/bitmapset.h +1 -1
  165. data/ext/pg_query/include/nodes/execnodes.h +270 -78
  166. data/ext/pg_query/include/nodes/extensible.h +4 -2
  167. data/ext/pg_query/include/nodes/lockoptions.h +1 -1
  168. data/ext/pg_query/include/nodes/makefuncs.h +7 -6
  169. data/ext/pg_query/include/nodes/memnodes.h +5 -3
  170. data/ext/pg_query/include/nodes/nodeFuncs.h +1 -1
  171. data/ext/pg_query/include/nodes/nodes.h +30 -11
  172. data/ext/pg_query/include/nodes/params.h +1 -1
  173. data/ext/pg_query/include/nodes/parsenodes.h +322 -90
  174. data/ext/pg_query/include/nodes/pathnodes.h +243 -66
  175. data/ext/pg_query/include/nodes/pg_list.h +75 -69
  176. data/ext/pg_query/include/nodes/plannodes.h +111 -28
  177. data/ext/pg_query/include/nodes/primnodes.h +99 -47
  178. data/ext/pg_query/include/nodes/print.h +1 -1
  179. data/ext/pg_query/include/nodes/tidbitmap.h +1 -1
  180. data/ext/pg_query/include/nodes/value.h +58 -39
  181. data/ext/pg_query/include/optimizer/cost.h +9 -2
  182. data/ext/pg_query/include/optimizer/geqo.h +9 -7
  183. data/ext/pg_query/include/optimizer/geqo_gene.h +1 -1
  184. data/ext/pg_query/include/optimizer/optimizer.h +25 -17
  185. data/ext/pg_query/include/optimizer/paths.h +6 -6
  186. data/ext/pg_query/include/optimizer/planmain.h +15 -14
  187. data/ext/pg_query/include/parser/analyze.h +19 -5
  188. data/ext/pg_query/include/parser/gram.h +947 -913
  189. data/ext/pg_query/include/parser/gramparse.h +1 -1
  190. data/ext/pg_query/include/parser/kwlist.h +463 -453
  191. data/ext/pg_query/include/parser/parse_agg.h +2 -7
  192. data/ext/pg_query/include/parser/parse_coerce.h +3 -1
  193. data/ext/pg_query/include/parser/parse_expr.h +2 -3
  194. data/ext/pg_query/include/parser/parse_func.h +2 -1
  195. data/ext/pg_query/include/parser/parse_node.h +21 -9
  196. data/ext/pg_query/include/parser/parse_oper.h +1 -3
  197. data/ext/pg_query/include/parser/parse_relation.h +5 -4
  198. data/ext/pg_query/include/parser/parse_type.h +1 -1
  199. data/ext/pg_query/include/parser/parser.h +31 -4
  200. data/ext/pg_query/include/parser/parsetree.h +1 -1
  201. data/ext/pg_query/include/parser/scanner.h +1 -1
  202. data/ext/pg_query/include/parser/scansup.h +2 -5
  203. data/ext/pg_query/include/partitioning/partdefs.h +1 -1
  204. data/ext/pg_query/include/pg_config.h +83 -41
  205. data/ext/pg_query/include/pg_config_manual.h +74 -21
  206. data/ext/pg_query/include/pg_getopt.h +6 -6
  207. data/ext/pg_query/include/pg_query.h +5 -4
  208. data/ext/pg_query/include/pg_query_enum_defs.c +358 -241
  209. data/ext/pg_query/include/pg_query_fingerprint_conds.c +44 -7
  210. data/ext/pg_query/include/pg_query_fingerprint_defs.c +939 -113
  211. data/ext/pg_query/include/pg_query_outfuncs_conds.c +43 -13
  212. data/ext/pg_query/include/pg_query_outfuncs_defs.c +151 -26
  213. data/ext/pg_query/include/pg_query_readfuncs_conds.c +11 -2
  214. data/ext/pg_query/include/pg_query_readfuncs_defs.c +173 -30
  215. data/ext/pg_query/include/pg_trace.h +1 -1
  216. data/ext/pg_query/include/pgstat.h +449 -1238
  217. data/ext/pg_query/include/pgtime.h +14 -4
  218. data/ext/pg_query/include/pl_gram.h +126 -128
  219. data/ext/pg_query/include/pl_reserved_kwlist.h +1 -1
  220. data/ext/pg_query/include/pl_reserved_kwlist_d.h +10 -10
  221. data/ext/pg_query/include/pl_unreserved_kwlist.h +2 -3
  222. data/ext/pg_query/include/pl_unreserved_kwlist_d.h +54 -56
  223. data/ext/pg_query/include/plerrcodes.h +9 -1
  224. data/ext/pg_query/include/plpgsql.h +52 -54
  225. data/ext/pg_query/include/port/atomics/arch-arm.h +7 -1
  226. data/ext/pg_query/include/port/atomics/arch-ppc.h +1 -1
  227. data/ext/pg_query/include/port/atomics/arch-x86.h +1 -1
  228. data/ext/pg_query/include/port/atomics/fallback.h +1 -1
  229. data/ext/pg_query/include/port/atomics/generic-gcc.h +3 -3
  230. data/ext/pg_query/include/port/atomics/generic.h +1 -1
  231. data/ext/pg_query/include/port/atomics.h +1 -1
  232. data/ext/pg_query/include/port/pg_bitutils.h +40 -10
  233. data/ext/pg_query/include/port/pg_bswap.h +1 -1
  234. data/ext/pg_query/include/port/pg_crc32c.h +1 -1
  235. data/ext/pg_query/include/port.h +71 -46
  236. data/ext/pg_query/include/portability/instr_time.h +1 -1
  237. data/ext/pg_query/include/postgres.h +60 -16
  238. data/ext/pg_query/include/postmaster/autovacuum.h +17 -17
  239. data/ext/pg_query/include/postmaster/auxprocess.h +20 -0
  240. data/ext/pg_query/include/postmaster/bgworker.h +2 -1
  241. data/ext/pg_query/include/postmaster/bgworker_internals.h +2 -2
  242. data/ext/pg_query/include/postmaster/bgwriter.h +5 -5
  243. data/ext/pg_query/include/postmaster/fork_process.h +1 -1
  244. data/ext/pg_query/include/postmaster/interrupt.h +1 -1
  245. data/ext/pg_query/include/postmaster/pgarch.h +42 -8
  246. data/ext/pg_query/include/postmaster/postmaster.h +18 -17
  247. data/ext/pg_query/include/postmaster/startup.h +39 -0
  248. data/ext/pg_query/include/postmaster/syslogger.h +15 -10
  249. data/ext/pg_query/include/postmaster/walwriter.h +3 -3
  250. data/ext/pg_query/include/protobuf/pg_query.pb-c.h +1419 -914
  251. data/ext/pg_query/include/protobuf/pg_query.pb.h +43678 -32769
  252. data/ext/pg_query/include/regex/regex.h +18 -16
  253. data/ext/pg_query/include/replication/logicallauncher.h +3 -5
  254. data/ext/pg_query/include/replication/logicalproto.h +161 -17
  255. data/ext/pg_query/include/replication/logicalworker.h +1 -1
  256. data/ext/pg_query/include/replication/origin.h +7 -7
  257. data/ext/pg_query/include/replication/reorderbuffer.h +259 -42
  258. data/ext/pg_query/include/replication/slot.h +22 -11
  259. data/ext/pg_query/include/replication/syncrep.h +5 -5
  260. data/ext/pg_query/include/replication/walreceiver.h +145 -13
  261. data/ext/pg_query/include/replication/walsender.h +8 -8
  262. data/ext/pg_query/include/rewrite/prs2lock.h +1 -1
  263. data/ext/pg_query/include/rewrite/rewriteHandler.h +1 -3
  264. data/ext/pg_query/include/rewrite/rewriteManip.h +1 -1
  265. data/ext/pg_query/include/rewrite/rewriteSupport.h +1 -1
  266. data/ext/pg_query/include/storage/backendid.h +3 -3
  267. data/ext/pg_query/include/storage/block.h +4 -10
  268. data/ext/pg_query/include/storage/buf.h +1 -1
  269. data/ext/pg_query/include/storage/bufmgr.h +19 -14
  270. data/ext/pg_query/include/storage/bufpage.h +6 -8
  271. data/ext/pg_query/include/storage/condition_variable.h +13 -2
  272. data/ext/pg_query/include/storage/dsm.h +4 -1
  273. data/ext/pg_query/include/storage/dsm_impl.h +3 -2
  274. data/ext/pg_query/include/storage/fd.h +33 -3
  275. data/ext/pg_query/include/storage/fileset.h +40 -0
  276. data/ext/pg_query/include/storage/ipc.h +4 -1
  277. data/ext/pg_query/include/storage/item.h +1 -1
  278. data/ext/pg_query/include/storage/itemid.h +1 -1
  279. data/ext/pg_query/include/storage/itemptr.h +3 -1
  280. data/ext/pg_query/include/storage/large_object.h +2 -2
  281. data/ext/pg_query/include/storage/latch.h +9 -13
  282. data/ext/pg_query/include/storage/lmgr.h +2 -1
  283. data/ext/pg_query/include/storage/lock.h +11 -8
  284. data/ext/pg_query/include/storage/lockdefs.h +2 -2
  285. data/ext/pg_query/include/storage/lwlock.h +5 -32
  286. data/ext/pg_query/include/storage/lwlocknames.h +0 -1
  287. data/ext/pg_query/include/storage/off.h +1 -1
  288. data/ext/pg_query/include/storage/pg_sema.h +1 -1
  289. data/ext/pg_query/include/storage/pg_shmem.h +9 -7
  290. data/ext/pg_query/include/storage/pmsignal.h +15 -4
  291. data/ext/pg_query/include/storage/predicate.h +4 -4
  292. data/ext/pg_query/include/storage/proc.h +173 -59
  293. data/ext/pg_query/include/storage/procarray.h +98 -0
  294. data/ext/pg_query/include/storage/proclist_types.h +1 -1
  295. data/ext/pg_query/include/storage/procsignal.h +3 -7
  296. data/ext/pg_query/include/storage/relfilenode.h +1 -1
  297. data/ext/pg_query/include/storage/s_lock.h +60 -21
  298. data/ext/pg_query/include/storage/sharedfileset.h +3 -11
  299. data/ext/pg_query/include/storage/shm_mq.h +5 -4
  300. data/ext/pg_query/include/storage/shm_toc.h +1 -1
  301. data/ext/pg_query/include/storage/shmem.h +1 -1
  302. data/ext/pg_query/include/storage/sinval.h +3 -3
  303. data/ext/pg_query/include/storage/sinvaladt.h +1 -1
  304. data/ext/pg_query/include/storage/smgr.h +10 -8
  305. data/ext/pg_query/include/storage/spin.h +2 -2
  306. data/ext/pg_query/include/storage/standby.h +13 -6
  307. data/ext/pg_query/include/storage/standbydefs.h +2 -2
  308. data/ext/pg_query/include/storage/sync.h +7 -3
  309. data/ext/pg_query/include/tcop/cmdtag.h +1 -1
  310. data/ext/pg_query/include/tcop/cmdtaglist.h +3 -2
  311. data/ext/pg_query/include/tcop/deparse_utility.h +1 -1
  312. data/ext/pg_query/include/tcop/dest.h +1 -1
  313. data/ext/pg_query/include/tcop/fastpath.h +1 -2
  314. data/ext/pg_query/include/tcop/pquery.h +1 -1
  315. data/ext/pg_query/include/tcop/tcopprot.h +19 -11
  316. data/ext/pg_query/include/tcop/utility.h +7 -3
  317. data/ext/pg_query/include/tsearch/ts_cache.h +2 -2
  318. data/ext/pg_query/include/utils/acl.h +24 -3
  319. data/ext/pg_query/include/utils/aclchk_internal.h +1 -1
  320. data/ext/pg_query/include/utils/array.h +7 -2
  321. data/ext/pg_query/include/utils/backend_progress.h +44 -0
  322. data/ext/pg_query/include/utils/backend_status.h +321 -0
  323. data/ext/pg_query/include/utils/builtins.h +10 -11
  324. data/ext/pg_query/include/utils/bytea.h +3 -2
  325. data/ext/pg_query/include/utils/catcache.h +1 -1
  326. data/ext/pg_query/include/utils/date.h +1 -1
  327. data/ext/pg_query/include/utils/datetime.h +8 -7
  328. data/ext/pg_query/include/utils/datum.h +9 -1
  329. data/ext/pg_query/include/utils/dsa.h +1 -1
  330. data/ext/pg_query/include/utils/dynahash.h +4 -3
  331. data/ext/pg_query/include/utils/elog.h +52 -21
  332. data/ext/pg_query/include/utils/errcodes.h +2 -0
  333. data/ext/pg_query/include/utils/expandeddatum.h +1 -1
  334. data/ext/pg_query/include/utils/expandedrecord.h +1 -1
  335. data/ext/pg_query/include/utils/float.h +7 -7
  336. data/ext/pg_query/include/utils/fmgroids.h +1300 -696
  337. data/ext/pg_query/include/utils/fmgrprotos.h +199 -16
  338. data/ext/pg_query/include/utils/fmgrtab.h +6 -5
  339. data/ext/pg_query/include/utils/guc.h +69 -43
  340. data/ext/pg_query/include/utils/guc_tables.h +23 -19
  341. data/ext/pg_query/include/utils/hsearch.h +15 -11
  342. data/ext/pg_query/include/utils/inval.h +4 -1
  343. data/ext/pg_query/include/utils/lsyscache.h +11 -1
  344. data/ext/pg_query/include/utils/memdebug.h +1 -1
  345. data/ext/pg_query/include/utils/memutils.h +8 -3
  346. data/ext/pg_query/include/utils/numeric.h +19 -5
  347. data/ext/pg_query/include/utils/palloc.h +25 -3
  348. data/ext/pg_query/include/utils/partcache.h +1 -1
  349. data/ext/pg_query/include/utils/pg_locale.h +17 -9
  350. data/ext/pg_query/include/utils/pg_lsn.h +1 -1
  351. data/ext/pg_query/include/utils/pgstat_internal.h +784 -0
  352. data/ext/pg_query/include/utils/pidfile.h +1 -1
  353. data/ext/pg_query/include/utils/plancache.h +6 -5
  354. data/ext/pg_query/include/utils/portal.h +10 -12
  355. data/ext/pg_query/include/utils/ps_status.h +1 -1
  356. data/ext/pg_query/include/utils/queryenvironment.h +1 -1
  357. data/ext/pg_query/include/utils/queryjumble.h +88 -0
  358. data/ext/pg_query/include/utils/regproc.h +14 -3
  359. data/ext/pg_query/include/utils/rel.h +71 -19
  360. data/ext/pg_query/include/utils/relcache.h +8 -5
  361. data/ext/pg_query/include/utils/reltrigger.h +1 -1
  362. data/ext/pg_query/include/utils/resowner.h +1 -1
  363. data/ext/pg_query/include/utils/rls.h +2 -2
  364. data/ext/pg_query/include/utils/ruleutils.h +4 -1
  365. data/ext/pg_query/include/utils/sharedtuplestore.h +1 -1
  366. data/ext/pg_query/include/utils/snapmgr.h +34 -14
  367. data/ext/pg_query/include/utils/snapshot.h +14 -1
  368. data/ext/pg_query/include/utils/sortsupport.h +117 -2
  369. data/ext/pg_query/include/utils/syscache.h +6 -1
  370. data/ext/pg_query/include/utils/timeout.h +11 -4
  371. data/ext/pg_query/include/utils/timestamp.h +6 -5
  372. data/ext/pg_query/include/utils/tuplesort.h +25 -11
  373. data/ext/pg_query/include/utils/tuplestore.h +2 -2
  374. data/ext/pg_query/include/utils/typcache.h +24 -17
  375. data/ext/pg_query/include/utils/tzparser.h +1 -1
  376. data/ext/pg_query/include/utils/varlena.h +5 -3
  377. data/ext/pg_query/include/utils/wait_event.h +289 -0
  378. data/ext/pg_query/include/utils/xml.h +4 -4
  379. data/ext/pg_query/pg_query.pb-c.c +4302 -2304
  380. data/ext/pg_query/pg_query_deparse.c +986 -301
  381. data/ext/pg_query/pg_query_fingerprint.c +30 -10
  382. data/ext/pg_query/pg_query_json_plpgsql.c +0 -25
  383. data/ext/pg_query/pg_query_normalize.c +1 -1
  384. data/ext/pg_query/pg_query_outfuncs_json.c +54 -16
  385. data/ext/pg_query/pg_query_outfuncs_protobuf.c +70 -10
  386. data/ext/pg_query/pg_query_parse.c +1 -1
  387. data/ext/pg_query/pg_query_readfuncs_protobuf.c +42 -8
  388. data/ext/pg_query/pg_query_scan.c +2 -1
  389. data/ext/pg_query/pg_query_split.c +3 -2
  390. data/ext/pg_query/src_backend_catalog_namespace.c +20 -9
  391. data/ext/pg_query/src_backend_catalog_pg_proc.c +4 -1
  392. data/ext/pg_query/src_backend_commands_define.c +11 -1
  393. data/ext/pg_query/src_backend_nodes_bitmapset.c +3 -1
  394. data/ext/pg_query/src_backend_nodes_copyfuncs.c +401 -76
  395. data/ext/pg_query/src_backend_nodes_equalfuncs.c +290 -46
  396. data/ext/pg_query/src_backend_nodes_extensible.c +1 -1
  397. data/ext/pg_query/src_backend_nodes_list.c +74 -11
  398. data/ext/pg_query/src_backend_nodes_makefuncs.c +5 -4
  399. data/ext/pg_query/src_backend_nodes_nodeFuncs.c +55 -12
  400. data/ext/pg_query/src_backend_nodes_value.c +28 -19
  401. data/ext/pg_query/src_backend_parser_gram.c +33874 -31261
  402. data/ext/pg_query/src_backend_parser_parser.c +26 -7
  403. data/ext/pg_query/src_backend_parser_scan.c +172 -209
  404. data/ext/pg_query/src_backend_parser_scansup.c +4 -28
  405. data/ext/pg_query/src_backend_postmaster_postmaster.c +77 -106
  406. data/ext/pg_query/src_backend_storage_ipc_ipc.c +13 -4
  407. data/ext/pg_query/src_backend_storage_lmgr_s_lock.c +5 -4
  408. data/ext/pg_query/src_backend_tcop_postgres.c +62 -23
  409. data/ext/pg_query/src_backend_utils_activity_pgstat_database.c +140 -0
  410. data/ext/pg_query/src_backend_utils_adt_datum.c +13 -1
  411. data/ext/pg_query/src_backend_utils_adt_expandeddatum.c +1 -1
  412. data/ext/pg_query/src_backend_utils_adt_format_type.c +6 -2
  413. data/ext/pg_query/src_backend_utils_adt_ruleutils.c +71 -5
  414. data/ext/pg_query/src_backend_utils_error_assert.c +16 -14
  415. data/ext/pg_query/src_backend_utils_error_elog.c +172 -99
  416. data/ext/pg_query/src_backend_utils_fmgr_fmgr.c +12 -17
  417. data/ext/pg_query/src_backend_utils_hash_dynahash.c +40 -10
  418. data/ext/pg_query/src_backend_utils_init_globals.c +5 -5
  419. data/ext/pg_query/src_backend_utils_mb_mbutils.c +55 -66
  420. data/ext/pg_query/src_backend_utils_misc_guc.c +206 -45
  421. data/ext/pg_query/src_backend_utils_mmgr_aset.c +7 -5
  422. data/ext/pg_query/src_backend_utils_mmgr_mcxt.c +123 -35
  423. data/ext/pg_query/src_common_encnames.c +1 -1
  424. data/ext/pg_query/src_common_hashfn.c +3 -3
  425. data/ext/pg_query/src_common_keywords.c +15 -2
  426. data/ext/pg_query/src_common_kwlist_d.h +517 -494
  427. data/ext/pg_query/src_common_kwlookup.c +1 -1
  428. data/ext/pg_query/src_common_pg_prng.c +152 -0
  429. data/ext/pg_query/src_common_psprintf.c +1 -1
  430. data/ext/pg_query/src_common_string.c +7 -1
  431. data/ext/pg_query/src_common_stringinfo.c +1 -1
  432. data/ext/pg_query/src_common_wchar.c +701 -109
  433. data/ext/pg_query/src_pl_plpgsql_src_pl_comp.c +45 -20
  434. data/ext/pg_query/src_pl_plpgsql_src_pl_funcs.c +1 -18
  435. data/ext/pg_query/src_pl_plpgsql_src_pl_gram.c +1233 -1259
  436. data/ext/pg_query/src_pl_plpgsql_src_pl_handler.c +1 -1
  437. data/ext/pg_query/src_pl_plpgsql_src_pl_reserved_kwlist_d.h +10 -10
  438. data/ext/pg_query/src_pl_plpgsql_src_pl_scanner.c +2 -2
  439. data/ext/pg_query/src_pl_plpgsql_src_pl_unreserved_kwlist_d.h +54 -56
  440. data/ext/pg_query/src_port_pg_bitutils.c +41 -31
  441. data/ext/pg_query/src_port_pgsleep.c +1 -1
  442. data/ext/pg_query/src_port_pgstrcasecmp.c +1 -1
  443. data/ext/pg_query/src_port_qsort.c +12 -224
  444. data/ext/pg_query/src_port_snprintf.c +37 -13
  445. data/ext/pg_query/src_port_strerror.c +9 -19
  446. data/ext/pg_query/src_port_strnlen.c +1 -1
  447. data/lib/pg_query/filter_columns.rb +1 -1
  448. data/lib/pg_query/fingerprint.rb +5 -1
  449. data/lib/pg_query/node.rb +2 -2
  450. data/lib/pg_query/param_refs.rb +1 -1
  451. data/lib/pg_query/parse.rb +8 -7
  452. data/lib/pg_query/pg_query_pb.rb +1108 -942
  453. data/lib/pg_query/truncate.rb +1 -1
  454. data/lib/pg_query/version.rb +1 -1
  455. metadata +23 -13
  456. data/ext/pg_query/include/access/xloginsert.h +0 -64
  457. data/ext/pg_query/include/bootstrap/bootstrap.h +0 -62
  458. data/ext/pg_query/include/parser/parse_clause.h +0 -54
  459. data/ext/pg_query/include/parser/parse_collate.h +0 -27
  460. data/ext/pg_query/include/parser/parse_target.h +0 -46
  461. data/ext/pg_query/pg_query_ruby_freebsd.sym +0 -2
  462. data/ext/pg_query/src_backend_libpq_pqcomm.c +0 -659
  463. data/ext/pg_query/src_backend_parser_parse_expr.c +0 -313
  464. data/ext/pg_query/src_port_erand48.c +0 -127
  465. data/ext/pg_query/src_port_random.c +0 -31
@@ -1,7 +1,6 @@
1
1
  static void _fingerprintAlias(FingerprintContext *ctx, const Alias *node, const void *parent, const char *field_name, unsigned int depth);
2
2
  static void _fingerprintRangeVar(FingerprintContext *ctx, const RangeVar *node, const void *parent, const char *field_name, unsigned int depth);
3
3
  static void _fingerprintTableFunc(FingerprintContext *ctx, const TableFunc *node, const void *parent, const char *field_name, unsigned int depth);
4
- static void _fingerprintExpr(FingerprintContext *ctx, const Expr *node, const void *parent, const char *field_name, unsigned int depth);
5
4
  static void _fingerprintVar(FingerprintContext *ctx, const Var *node, const void *parent, const char *field_name, unsigned int depth);
6
5
  static void _fingerprintConst(FingerprintContext *ctx, const Const *node, const void *parent, const char *field_name, unsigned int depth);
7
6
  static void _fingerprintParam(FingerprintContext *ctx, const Param *node, const void *parent, const char *field_name, unsigned int depth);
@@ -48,12 +47,16 @@ static void _fingerprintJoinExpr(FingerprintContext *ctx, const JoinExpr *node,
48
47
  static void _fingerprintFromExpr(FingerprintContext *ctx, const FromExpr *node, const void *parent, const char *field_name, unsigned int depth);
49
48
  static void _fingerprintOnConflictExpr(FingerprintContext *ctx, const OnConflictExpr *node, const void *parent, const char *field_name, unsigned int depth);
50
49
  static void _fingerprintIntoClause(FingerprintContext *ctx, const IntoClause *node, const void *parent, const char *field_name, unsigned int depth);
50
+ static void _fingerprintMergeAction(FingerprintContext *ctx, const MergeAction *node, const void *parent, const char *field_name, unsigned int depth);
51
51
  static void _fingerprintRawStmt(FingerprintContext *ctx, const RawStmt *node, const void *parent, const char *field_name, unsigned int depth);
52
52
  static void _fingerprintQuery(FingerprintContext *ctx, const Query *node, const void *parent, const char *field_name, unsigned int depth);
53
53
  static void _fingerprintInsertStmt(FingerprintContext *ctx, const InsertStmt *node, const void *parent, const char *field_name, unsigned int depth);
54
54
  static void _fingerprintDeleteStmt(FingerprintContext *ctx, const DeleteStmt *node, const void *parent, const char *field_name, unsigned int depth);
55
55
  static void _fingerprintUpdateStmt(FingerprintContext *ctx, const UpdateStmt *node, const void *parent, const char *field_name, unsigned int depth);
56
+ static void _fingerprintMergeStmt(FingerprintContext *ctx, const MergeStmt *node, const void *parent, const char *field_name, unsigned int depth);
56
57
  static void _fingerprintSelectStmt(FingerprintContext *ctx, const SelectStmt *node, const void *parent, const char *field_name, unsigned int depth);
58
+ static void _fingerprintReturnStmt(FingerprintContext *ctx, const ReturnStmt *node, const void *parent, const char *field_name, unsigned int depth);
59
+ static void _fingerprintPLAssignStmt(FingerprintContext *ctx, const PLAssignStmt *node, const void *parent, const char *field_name, unsigned int depth);
57
60
  static void _fingerprintAlterTableStmt(FingerprintContext *ctx, const AlterTableStmt *node, const void *parent, const char *field_name, unsigned int depth);
58
61
  static void _fingerprintAlterTableCmd(FingerprintContext *ctx, const AlterTableCmd *node, const void *parent, const char *field_name, unsigned int depth);
59
62
  static void _fingerprintAlterDomainStmt(FingerprintContext *ctx, const AlterDomainStmt *node, const void *parent, const char *field_name, unsigned int depth);
@@ -104,6 +107,7 @@ static void _fingerprintReindexStmt(FingerprintContext *ctx, const ReindexStmt *
104
107
  static void _fingerprintCheckPointStmt(FingerprintContext *ctx, const CheckPointStmt *node, const void *parent, const char *field_name, unsigned int depth);
105
108
  static void _fingerprintCreateSchemaStmt(FingerprintContext *ctx, const CreateSchemaStmt *node, const void *parent, const char *field_name, unsigned int depth);
106
109
  static void _fingerprintAlterDatabaseStmt(FingerprintContext *ctx, const AlterDatabaseStmt *node, const void *parent, const char *field_name, unsigned int depth);
110
+ static void _fingerprintAlterDatabaseRefreshCollStmt(FingerprintContext *ctx, const AlterDatabaseRefreshCollStmt *node, const void *parent, const char *field_name, unsigned int depth);
107
111
  static void _fingerprintAlterDatabaseSetStmt(FingerprintContext *ctx, const AlterDatabaseSetStmt *node, const void *parent, const char *field_name, unsigned int depth);
108
112
  static void _fingerprintAlterRoleSetStmt(FingerprintContext *ctx, const AlterRoleSetStmt *node, const void *parent, const char *field_name, unsigned int depth);
109
113
  static void _fingerprintCreateConversionStmt(FingerprintContext *ctx, const CreateConversionStmt *node, const void *parent, const char *field_name, unsigned int depth);
@@ -166,7 +170,6 @@ static void _fingerprintAlterStatsStmt(FingerprintContext *ctx, const AlterStats
166
170
  static void _fingerprintA_Expr(FingerprintContext *ctx, const A_Expr *node, const void *parent, const char *field_name, unsigned int depth);
167
171
  static void _fingerprintColumnRef(FingerprintContext *ctx, const ColumnRef *node, const void *parent, const char *field_name, unsigned int depth);
168
172
  static void _fingerprintParamRef(FingerprintContext *ctx, const ParamRef *node, const void *parent, const char *field_name, unsigned int depth);
169
- static void _fingerprintA_Const(FingerprintContext *ctx, const A_Const *node, const void *parent, const char *field_name, unsigned int depth);
170
173
  static void _fingerprintFuncCall(FingerprintContext *ctx, const FuncCall *node, const void *parent, const char *field_name, unsigned int depth);
171
174
  static void _fingerprintA_Star(FingerprintContext *ctx, const A_Star *node, const void *parent, const char *field_name, unsigned int depth);
172
175
  static void _fingerprintA_Indices(FingerprintContext *ctx, const A_Indices *node, const void *parent, const char *field_name, unsigned int depth);
@@ -186,6 +189,7 @@ static void _fingerprintRangeTableFuncCol(FingerprintContext *ctx, const RangeTa
186
189
  static void _fingerprintTypeName(FingerprintContext *ctx, const TypeName *node, const void *parent, const char *field_name, unsigned int depth);
187
190
  static void _fingerprintColumnDef(FingerprintContext *ctx, const ColumnDef *node, const void *parent, const char *field_name, unsigned int depth);
188
191
  static void _fingerprintIndexElem(FingerprintContext *ctx, const IndexElem *node, const void *parent, const char *field_name, unsigned int depth);
192
+ static void _fingerprintStatsElem(FingerprintContext *ctx, const StatsElem *node, const void *parent, const char *field_name, unsigned int depth);
189
193
  static void _fingerprintConstraint(FingerprintContext *ctx, const Constraint *node, const void *parent, const char *field_name, unsigned int depth);
190
194
  static void _fingerprintDefElem(FingerprintContext *ctx, const DefElem *node, const void *parent, const char *field_name, unsigned int depth);
191
195
  static void _fingerprintRangeTblEntry(FingerprintContext *ctx, const RangeTblEntry *node, const void *parent, const char *field_name, unsigned int depth);
@@ -206,7 +210,10 @@ static void _fingerprintXmlSerialize(FingerprintContext *ctx, const XmlSerialize
206
210
  static void _fingerprintWithClause(FingerprintContext *ctx, const WithClause *node, const void *parent, const char *field_name, unsigned int depth);
207
211
  static void _fingerprintInferClause(FingerprintContext *ctx, const InferClause *node, const void *parent, const char *field_name, unsigned int depth);
208
212
  static void _fingerprintOnConflictClause(FingerprintContext *ctx, const OnConflictClause *node, const void *parent, const char *field_name, unsigned int depth);
213
+ static void _fingerprintCTESearchClause(FingerprintContext *ctx, const CTESearchClause *node, const void *parent, const char *field_name, unsigned int depth);
214
+ static void _fingerprintCTECycleClause(FingerprintContext *ctx, const CTECycleClause *node, const void *parent, const char *field_name, unsigned int depth);
209
215
  static void _fingerprintCommonTableExpr(FingerprintContext *ctx, const CommonTableExpr *node, const void *parent, const char *field_name, unsigned int depth);
216
+ static void _fingerprintMergeWhenClause(FingerprintContext *ctx, const MergeWhenClause *node, const void *parent, const char *field_name, unsigned int depth);
210
217
  static void _fingerprintRoleSpec(FingerprintContext *ctx, const RoleSpec *node, const void *parent, const char *field_name, unsigned int depth);
211
218
  static void _fingerprintTriggerTransition(FingerprintContext *ctx, const TriggerTransition *node, const void *parent, const char *field_name, unsigned int depth);
212
219
  static void _fingerprintPartitionElem(FingerprintContext *ctx, const PartitionElem *node, const void *parent, const char *field_name, unsigned int depth);
@@ -215,6 +222,8 @@ static void _fingerprintPartitionBoundSpec(FingerprintContext *ctx, const Partit
215
222
  static void _fingerprintPartitionRangeDatum(FingerprintContext *ctx, const PartitionRangeDatum *node, const void *parent, const char *field_name, unsigned int depth);
216
223
  static void _fingerprintPartitionCmd(FingerprintContext *ctx, const PartitionCmd *node, const void *parent, const char *field_name, unsigned int depth);
217
224
  static void _fingerprintVacuumRelation(FingerprintContext *ctx, const VacuumRelation *node, const void *parent, const char *field_name, unsigned int depth);
225
+ static void _fingerprintPublicationObjSpec(FingerprintContext *ctx, const PublicationObjSpec *node, const void *parent, const char *field_name, unsigned int depth);
226
+ static void _fingerprintPublicationTable(FingerprintContext *ctx, const PublicationTable *node, const void *parent, const char *field_name, unsigned int depth);
218
227
  static void _fingerprintInlineCodeBlock(FingerprintContext *ctx, const InlineCodeBlock *node, const void *parent, const char *field_name, unsigned int depth);
219
228
  static void _fingerprintCallContext(FingerprintContext *ctx, const CallContext *node, const void *parent, const char *field_name, unsigned int depth);
220
229
 
@@ -481,11 +490,6 @@ _fingerprintTableFunc(FingerprintContext *ctx, const TableFunc *node, const void
481
490
 
482
491
  }
483
492
 
484
- static void
485
- _fingerprintExpr(FingerprintContext *ctx, const Expr *node, const void *parent, const char *field_name, unsigned int depth)
486
- {
487
- }
488
-
489
493
  static void
490
494
  _fingerprintVar(FingerprintContext *ctx, const Var *node, const void *parent, const char *field_name, unsigned int depth)
491
495
  {
@@ -729,6 +733,13 @@ _fingerprintAggref(FingerprintContext *ctx, const Aggref *node, const void *pare
729
733
  _fingerprintString(ctx, buffer);
730
734
  }
731
735
 
736
+ if (node->aggno != 0) {
737
+ char buffer[50];
738
+ sprintf(buffer, "%d", node->aggno);
739
+ _fingerprintString(ctx, "aggno");
740
+ _fingerprintString(ctx, buffer);
741
+ }
742
+
732
743
  if (node->aggorder != NULL && node->aggorder->length > 0) {
733
744
  XXH3_state_t* prev = XXH3_createState();
734
745
  XXH64_hash_t hash;
@@ -755,6 +766,13 @@ _fingerprintAggref(FingerprintContext *ctx, const Aggref *node, const void *pare
755
766
  _fingerprintString(ctx, "true");
756
767
  }
757
768
 
769
+ if (node->aggtransno != 0) {
770
+ char buffer[50];
771
+ sprintf(buffer, "%d", node->aggtransno);
772
+ _fingerprintString(ctx, "aggtransno");
773
+ _fingerprintString(ctx, buffer);
774
+ }
775
+
758
776
  if (node->aggtranstype != 0) {
759
777
  char buffer[50];
760
778
  sprintf(buffer, "%d", node->aggtranstype);
@@ -1022,6 +1040,13 @@ _fingerprintSubscriptingRef(FingerprintContext *ctx, const SubscriptingRef *node
1022
1040
  }
1023
1041
  XXH3_freeState(prev);
1024
1042
  }
1043
+ if (node->refrestype != 0) {
1044
+ char buffer[50];
1045
+ sprintf(buffer, "%d", node->refrestype);
1046
+ _fingerprintString(ctx, "refrestype");
1047
+ _fingerprintString(ctx, buffer);
1048
+ }
1049
+
1025
1050
  if (node->reftypmod != 0) {
1026
1051
  char buffer[50];
1027
1052
  sprintf(buffer, "%d", node->reftypmod);
@@ -1231,6 +1256,13 @@ _fingerprintScalarArrayOpExpr(FingerprintContext *ctx, const ScalarArrayOpExpr *
1231
1256
  }
1232
1257
  XXH3_freeState(prev);
1233
1258
  }
1259
+ if (node->hashfuncid != 0) {
1260
+ char buffer[50];
1261
+ sprintf(buffer, "%d", node->hashfuncid);
1262
+ _fingerprintString(ctx, "hashfuncid");
1263
+ _fingerprintString(ctx, buffer);
1264
+ }
1265
+
1234
1266
  if (node->inputcollid != 0) {
1235
1267
  char buffer[50];
1236
1268
  sprintf(buffer, "%d", node->inputcollid);
@@ -1240,6 +1272,13 @@ _fingerprintScalarArrayOpExpr(FingerprintContext *ctx, const ScalarArrayOpExpr *
1240
1272
 
1241
1273
  // Intentionally ignoring node->location for fingerprinting
1242
1274
 
1275
+ if (node->negfuncid != 0) {
1276
+ char buffer[50];
1277
+ sprintf(buffer, "%d", node->negfuncid);
1278
+ _fingerprintString(ctx, "negfuncid");
1279
+ _fingerprintString(ctx, buffer);
1280
+ }
1281
+
1243
1282
  if (node->opfuncid != 0) {
1244
1283
  char buffer[50];
1245
1284
  sprintf(buffer, "%d", node->opfuncid);
@@ -2717,6 +2756,23 @@ _fingerprintJoinExpr(FingerprintContext *ctx, const JoinExpr *node, const void *
2717
2756
  _fingerprintString(ctx, "true");
2718
2757
  }
2719
2758
 
2759
+ if (node->join_using_alias != NULL) {
2760
+ XXH3_state_t* prev = XXH3_createState();
2761
+ XXH64_hash_t hash;
2762
+
2763
+ XXH3_copyState(prev, ctx->xxh_state);
2764
+ _fingerprintString(ctx, "join_using_alias");
2765
+
2766
+ hash = XXH3_64bits_digest(ctx->xxh_state);
2767
+ _fingerprintAlias(ctx, node->join_using_alias, node, "join_using_alias", depth + 1);
2768
+ if (hash == XXH3_64bits_digest(ctx->xxh_state)) {
2769
+ XXH3_copyState(ctx->xxh_state, prev);
2770
+ if (ctx->write_tokens)
2771
+ dlist_delete(dlist_tail_node(&ctx->tokens));
2772
+ }
2773
+ XXH3_freeState(prev);
2774
+ }
2775
+
2720
2776
  if (true) {
2721
2777
  _fingerprintString(ctx, "jointype");
2722
2778
  _fingerprintString(ctx, _enumToStringJoinType(node->jointype));
@@ -3033,6 +3089,75 @@ _fingerprintIntoClause(FingerprintContext *ctx, const IntoClause *node, const vo
3033
3089
 
3034
3090
  }
3035
3091
 
3092
+ static void
3093
+ _fingerprintMergeAction(FingerprintContext *ctx, const MergeAction *node, const void *parent, const char *field_name, unsigned int depth)
3094
+ {
3095
+ if (true) {
3096
+ _fingerprintString(ctx, "commandType");
3097
+ _fingerprintString(ctx, _enumToStringCmdType(node->commandType));
3098
+ }
3099
+
3100
+ if (node->matched) {
3101
+ _fingerprintString(ctx, "matched");
3102
+ _fingerprintString(ctx, "true");
3103
+ }
3104
+
3105
+ if (true) {
3106
+ _fingerprintString(ctx, "override");
3107
+ _fingerprintString(ctx, _enumToStringOverridingKind(node->override));
3108
+ }
3109
+
3110
+ if (node->qual != NULL) {
3111
+ XXH3_state_t* prev = XXH3_createState();
3112
+ XXH64_hash_t hash;
3113
+
3114
+ XXH3_copyState(prev, ctx->xxh_state);
3115
+ _fingerprintString(ctx, "qual");
3116
+
3117
+ hash = XXH3_64bits_digest(ctx->xxh_state);
3118
+ _fingerprintNode(ctx, node->qual, node, "qual", depth + 1);
3119
+ if (hash == XXH3_64bits_digest(ctx->xxh_state)) {
3120
+ XXH3_copyState(ctx->xxh_state, prev);
3121
+ if (ctx->write_tokens)
3122
+ dlist_delete(dlist_tail_node(&ctx->tokens));
3123
+ }
3124
+ XXH3_freeState(prev);
3125
+ }
3126
+
3127
+ if (node->targetList != NULL && node->targetList->length > 0) {
3128
+ XXH3_state_t* prev = XXH3_createState();
3129
+ XXH64_hash_t hash;
3130
+
3131
+ XXH3_copyState(prev, ctx->xxh_state);
3132
+ _fingerprintString(ctx, "targetList");
3133
+
3134
+ hash = XXH3_64bits_digest(ctx->xxh_state);
3135
+ _fingerprintNode(ctx, node->targetList, node, "targetList", depth + 1);
3136
+ if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->targetList) == 1 && linitial(node->targetList) == NIL)) {
3137
+ XXH3_copyState(ctx->xxh_state, prev);
3138
+ if (ctx->write_tokens)
3139
+ dlist_delete(dlist_tail_node(&ctx->tokens));
3140
+ }
3141
+ XXH3_freeState(prev);
3142
+ }
3143
+ if (node->updateColnos != NULL && node->updateColnos->length > 0) {
3144
+ XXH3_state_t* prev = XXH3_createState();
3145
+ XXH64_hash_t hash;
3146
+
3147
+ XXH3_copyState(prev, ctx->xxh_state);
3148
+ _fingerprintString(ctx, "updateColnos");
3149
+
3150
+ hash = XXH3_64bits_digest(ctx->xxh_state);
3151
+ _fingerprintNode(ctx, node->updateColnos, node, "updateColnos", depth + 1);
3152
+ if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->updateColnos) == 1 && linitial(node->updateColnos) == NIL)) {
3153
+ XXH3_copyState(ctx->xxh_state, prev);
3154
+ if (ctx->write_tokens)
3155
+ dlist_delete(dlist_tail_node(&ctx->tokens));
3156
+ }
3157
+ XXH3_freeState(prev);
3158
+ }
3159
+ }
3160
+
3036
3161
  static void
3037
3162
  _fingerprintRawStmt(FingerprintContext *ctx, const RawStmt *node, const void *parent, const char *field_name, unsigned int depth)
3038
3163
  {
@@ -3136,6 +3261,11 @@ _fingerprintQuery(FingerprintContext *ctx, const Query *node, const void *parent
3136
3261
  }
3137
3262
  XXH3_freeState(prev);
3138
3263
  }
3264
+ if (node->groupDistinct) {
3265
+ _fingerprintString(ctx, "groupDistinct");
3266
+ _fingerprintString(ctx, "true");
3267
+ }
3268
+
3139
3269
  if (node->groupingSets != NULL && node->groupingSets->length > 0) {
3140
3270
  XXH3_state_t* prev = XXH3_createState();
3141
3271
  XXH64_hash_t hash;
@@ -3214,6 +3344,11 @@ _fingerprintQuery(FingerprintContext *ctx, const Query *node, const void *parent
3214
3344
  XXH3_freeState(prev);
3215
3345
  }
3216
3346
 
3347
+ if (node->isReturn) {
3348
+ _fingerprintString(ctx, "isReturn");
3349
+ _fingerprintString(ctx, "true");
3350
+ }
3351
+
3217
3352
  if (node->jointree != NULL) {
3218
3353
  XXH3_state_t* prev = XXH3_createState();
3219
3354
  XXH64_hash_t hash;
@@ -3270,6 +3405,27 @@ _fingerprintQuery(FingerprintContext *ctx, const Query *node, const void *parent
3270
3405
  _fingerprintString(ctx, _enumToStringLimitOption(node->limitOption));
3271
3406
  }
3272
3407
 
3408
+ if (node->mergeActionList != NULL && node->mergeActionList->length > 0) {
3409
+ XXH3_state_t* prev = XXH3_createState();
3410
+ XXH64_hash_t hash;
3411
+
3412
+ XXH3_copyState(prev, ctx->xxh_state);
3413
+ _fingerprintString(ctx, "mergeActionList");
3414
+
3415
+ hash = XXH3_64bits_digest(ctx->xxh_state);
3416
+ _fingerprintNode(ctx, node->mergeActionList, node, "mergeActionList", depth + 1);
3417
+ if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->mergeActionList) == 1 && linitial(node->mergeActionList) == NIL)) {
3418
+ XXH3_copyState(ctx->xxh_state, prev);
3419
+ if (ctx->write_tokens)
3420
+ dlist_delete(dlist_tail_node(&ctx->tokens));
3421
+ }
3422
+ XXH3_freeState(prev);
3423
+ }
3424
+ if (node->mergeUseOuterJoin) {
3425
+ _fingerprintString(ctx, "mergeUseOuterJoin");
3426
+ _fingerprintString(ctx, "true");
3427
+ }
3428
+
3273
3429
  if (node->onConflict != NULL) {
3274
3430
  XXH3_state_t* prev = XXH3_createState();
3275
3431
  XXH64_hash_t hash;
@@ -3775,6 +3931,95 @@ _fingerprintUpdateStmt(FingerprintContext *ctx, const UpdateStmt *node, const vo
3775
3931
 
3776
3932
  }
3777
3933
 
3934
+ static void
3935
+ _fingerprintMergeStmt(FingerprintContext *ctx, const MergeStmt *node, const void *parent, const char *field_name, unsigned int depth)
3936
+ {
3937
+ if (node->joinCondition != NULL) {
3938
+ XXH3_state_t* prev = XXH3_createState();
3939
+ XXH64_hash_t hash;
3940
+
3941
+ XXH3_copyState(prev, ctx->xxh_state);
3942
+ _fingerprintString(ctx, "joinCondition");
3943
+
3944
+ hash = XXH3_64bits_digest(ctx->xxh_state);
3945
+ _fingerprintNode(ctx, node->joinCondition, node, "joinCondition", depth + 1);
3946
+ if (hash == XXH3_64bits_digest(ctx->xxh_state)) {
3947
+ XXH3_copyState(ctx->xxh_state, prev);
3948
+ if (ctx->write_tokens)
3949
+ dlist_delete(dlist_tail_node(&ctx->tokens));
3950
+ }
3951
+ XXH3_freeState(prev);
3952
+ }
3953
+
3954
+ if (node->mergeWhenClauses != NULL && node->mergeWhenClauses->length > 0) {
3955
+ XXH3_state_t* prev = XXH3_createState();
3956
+ XXH64_hash_t hash;
3957
+
3958
+ XXH3_copyState(prev, ctx->xxh_state);
3959
+ _fingerprintString(ctx, "mergeWhenClauses");
3960
+
3961
+ hash = XXH3_64bits_digest(ctx->xxh_state);
3962
+ _fingerprintNode(ctx, node->mergeWhenClauses, node, "mergeWhenClauses", depth + 1);
3963
+ if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->mergeWhenClauses) == 1 && linitial(node->mergeWhenClauses) == NIL)) {
3964
+ XXH3_copyState(ctx->xxh_state, prev);
3965
+ if (ctx->write_tokens)
3966
+ dlist_delete(dlist_tail_node(&ctx->tokens));
3967
+ }
3968
+ XXH3_freeState(prev);
3969
+ }
3970
+ if (node->relation != NULL) {
3971
+ XXH3_state_t* prev = XXH3_createState();
3972
+ XXH64_hash_t hash;
3973
+
3974
+ XXH3_copyState(prev, ctx->xxh_state);
3975
+ _fingerprintString(ctx, "relation");
3976
+
3977
+ hash = XXH3_64bits_digest(ctx->xxh_state);
3978
+ _fingerprintRangeVar(ctx, node->relation, node, "relation", depth + 1);
3979
+ if (hash == XXH3_64bits_digest(ctx->xxh_state)) {
3980
+ XXH3_copyState(ctx->xxh_state, prev);
3981
+ if (ctx->write_tokens)
3982
+ dlist_delete(dlist_tail_node(&ctx->tokens));
3983
+ }
3984
+ XXH3_freeState(prev);
3985
+ }
3986
+
3987
+ if (node->sourceRelation != NULL) {
3988
+ XXH3_state_t* prev = XXH3_createState();
3989
+ XXH64_hash_t hash;
3990
+
3991
+ XXH3_copyState(prev, ctx->xxh_state);
3992
+ _fingerprintString(ctx, "sourceRelation");
3993
+
3994
+ hash = XXH3_64bits_digest(ctx->xxh_state);
3995
+ _fingerprintNode(ctx, node->sourceRelation, node, "sourceRelation", depth + 1);
3996
+ if (hash == XXH3_64bits_digest(ctx->xxh_state)) {
3997
+ XXH3_copyState(ctx->xxh_state, prev);
3998
+ if (ctx->write_tokens)
3999
+ dlist_delete(dlist_tail_node(&ctx->tokens));
4000
+ }
4001
+ XXH3_freeState(prev);
4002
+ }
4003
+
4004
+ if (node->withClause != NULL) {
4005
+ XXH3_state_t* prev = XXH3_createState();
4006
+ XXH64_hash_t hash;
4007
+
4008
+ XXH3_copyState(prev, ctx->xxh_state);
4009
+ _fingerprintString(ctx, "withClause");
4010
+
4011
+ hash = XXH3_64bits_digest(ctx->xxh_state);
4012
+ _fingerprintWithClause(ctx, node->withClause, node, "withClause", depth + 1);
4013
+ if (hash == XXH3_64bits_digest(ctx->xxh_state)) {
4014
+ XXH3_copyState(ctx->xxh_state, prev);
4015
+ if (ctx->write_tokens)
4016
+ dlist_delete(dlist_tail_node(&ctx->tokens));
4017
+ }
4018
+ XXH3_freeState(prev);
4019
+ }
4020
+
4021
+ }
4022
+
3778
4023
  static void
3779
4024
  _fingerprintSelectStmt(FingerprintContext *ctx, const SelectStmt *node, const void *parent, const char *field_name, unsigned int depth)
3780
4025
  {
@@ -3831,6 +4076,11 @@ _fingerprintSelectStmt(FingerprintContext *ctx, const SelectStmt *node, const vo
3831
4076
  }
3832
4077
  XXH3_freeState(prev);
3833
4078
  }
4079
+ if (node->groupDistinct) {
4080
+ _fingerprintString(ctx, "groupDistinct");
4081
+ _fingerprintString(ctx, "true");
4082
+ }
4083
+
3834
4084
  if (node->havingClause != NULL) {
3835
4085
  XXH3_state_t* prev = XXH3_createState();
3836
4086
  XXH64_hash_t hash;
@@ -4060,70 +4310,69 @@ _fingerprintSelectStmt(FingerprintContext *ctx, const SelectStmt *node, const vo
4060
4310
  }
4061
4311
 
4062
4312
  static void
4063
- _fingerprintAlterTableStmt(FingerprintContext *ctx, const AlterTableStmt *node, const void *parent, const char *field_name, unsigned int depth)
4313
+ _fingerprintReturnStmt(FingerprintContext *ctx, const ReturnStmt *node, const void *parent, const char *field_name, unsigned int depth)
4064
4314
  {
4065
- if (node->cmds != NULL && node->cmds->length > 0) {
4315
+ if (node->returnval != NULL) {
4066
4316
  XXH3_state_t* prev = XXH3_createState();
4067
4317
  XXH64_hash_t hash;
4068
4318
 
4069
4319
  XXH3_copyState(prev, ctx->xxh_state);
4070
- _fingerprintString(ctx, "cmds");
4320
+ _fingerprintString(ctx, "returnval");
4071
4321
 
4072
4322
  hash = XXH3_64bits_digest(ctx->xxh_state);
4073
- _fingerprintNode(ctx, node->cmds, node, "cmds", depth + 1);
4074
- if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->cmds) == 1 && linitial(node->cmds) == NIL)) {
4323
+ _fingerprintNode(ctx, node->returnval, node, "returnval", depth + 1);
4324
+ if (hash == XXH3_64bits_digest(ctx->xxh_state)) {
4075
4325
  XXH3_copyState(ctx->xxh_state, prev);
4076
4326
  if (ctx->write_tokens)
4077
4327
  dlist_delete(dlist_tail_node(&ctx->tokens));
4078
4328
  }
4079
4329
  XXH3_freeState(prev);
4080
4330
  }
4081
- if (node->missing_ok) {
4082
- _fingerprintString(ctx, "missing_ok");
4083
- _fingerprintString(ctx, "true");
4084
- }
4085
4331
 
4086
- if (node->relation != NULL) {
4332
+ }
4333
+
4334
+ static void
4335
+ _fingerprintPLAssignStmt(FingerprintContext *ctx, const PLAssignStmt *node, const void *parent, const char *field_name, unsigned int depth)
4336
+ {
4337
+ if (node->indirection != NULL && node->indirection->length > 0) {
4087
4338
  XXH3_state_t* prev = XXH3_createState();
4088
4339
  XXH64_hash_t hash;
4089
4340
 
4090
4341
  XXH3_copyState(prev, ctx->xxh_state);
4091
- _fingerprintString(ctx, "relation");
4342
+ _fingerprintString(ctx, "indirection");
4092
4343
 
4093
4344
  hash = XXH3_64bits_digest(ctx->xxh_state);
4094
- _fingerprintRangeVar(ctx, node->relation, node, "relation", depth + 1);
4095
- if (hash == XXH3_64bits_digest(ctx->xxh_state)) {
4345
+ _fingerprintNode(ctx, node->indirection, node, "indirection", depth + 1);
4346
+ if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->indirection) == 1 && linitial(node->indirection) == NIL)) {
4096
4347
  XXH3_copyState(ctx->xxh_state, prev);
4097
4348
  if (ctx->write_tokens)
4098
4349
  dlist_delete(dlist_tail_node(&ctx->tokens));
4099
4350
  }
4100
4351
  XXH3_freeState(prev);
4101
4352
  }
4353
+ // Intentionally ignoring node->location for fingerprinting
4102
4354
 
4103
- if (true) {
4104
- _fingerprintString(ctx, "relkind");
4105
- _fingerprintString(ctx, _enumToStringObjectType(node->relkind));
4355
+ if (node->name != NULL) {
4356
+ _fingerprintString(ctx, "name");
4357
+ _fingerprintString(ctx, node->name);
4106
4358
  }
4107
4359
 
4108
- }
4109
-
4110
- static void
4111
- _fingerprintAlterTableCmd(FingerprintContext *ctx, const AlterTableCmd *node, const void *parent, const char *field_name, unsigned int depth)
4112
- {
4113
- if (true) {
4114
- _fingerprintString(ctx, "behavior");
4115
- _fingerprintString(ctx, _enumToStringDropBehavior(node->behavior));
4360
+ if (node->nnames != 0) {
4361
+ char buffer[50];
4362
+ sprintf(buffer, "%d", node->nnames);
4363
+ _fingerprintString(ctx, "nnames");
4364
+ _fingerprintString(ctx, buffer);
4116
4365
  }
4117
4366
 
4118
- if (node->def != NULL) {
4367
+ if (node->val != NULL) {
4119
4368
  XXH3_state_t* prev = XXH3_createState();
4120
4369
  XXH64_hash_t hash;
4121
4370
 
4122
4371
  XXH3_copyState(prev, ctx->xxh_state);
4123
- _fingerprintString(ctx, "def");
4372
+ _fingerprintString(ctx, "val");
4124
4373
 
4125
4374
  hash = XXH3_64bits_digest(ctx->xxh_state);
4126
- _fingerprintNode(ctx, node->def, node, "def", depth + 1);
4375
+ _fingerprintSelectStmt(ctx, node->val, node, "val", depth + 1);
4127
4376
  if (hash == XXH3_64bits_digest(ctx->xxh_state)) {
4128
4377
  XXH3_copyState(ctx->xxh_state, prev);
4129
4378
  if (ctx->write_tokens)
@@ -4132,17 +4381,92 @@ _fingerprintAlterTableCmd(FingerprintContext *ctx, const AlterTableCmd *node, co
4132
4381
  XXH3_freeState(prev);
4133
4382
  }
4134
4383
 
4135
- if (node->missing_ok) {
4136
- _fingerprintString(ctx, "missing_ok");
4137
- _fingerprintString(ctx, "true");
4138
- }
4139
-
4140
- if (node->name != NULL) {
4141
- _fingerprintString(ctx, "name");
4142
- _fingerprintString(ctx, node->name);
4143
- }
4384
+ }
4144
4385
 
4145
- if (node->newowner != NULL) {
4386
+ static void
4387
+ _fingerprintAlterTableStmt(FingerprintContext *ctx, const AlterTableStmt *node, const void *parent, const char *field_name, unsigned int depth)
4388
+ {
4389
+ if (node->cmds != NULL && node->cmds->length > 0) {
4390
+ XXH3_state_t* prev = XXH3_createState();
4391
+ XXH64_hash_t hash;
4392
+
4393
+ XXH3_copyState(prev, ctx->xxh_state);
4394
+ _fingerprintString(ctx, "cmds");
4395
+
4396
+ hash = XXH3_64bits_digest(ctx->xxh_state);
4397
+ _fingerprintNode(ctx, node->cmds, node, "cmds", depth + 1);
4398
+ if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->cmds) == 1 && linitial(node->cmds) == NIL)) {
4399
+ XXH3_copyState(ctx->xxh_state, prev);
4400
+ if (ctx->write_tokens)
4401
+ dlist_delete(dlist_tail_node(&ctx->tokens));
4402
+ }
4403
+ XXH3_freeState(prev);
4404
+ }
4405
+ if (node->missing_ok) {
4406
+ _fingerprintString(ctx, "missing_ok");
4407
+ _fingerprintString(ctx, "true");
4408
+ }
4409
+
4410
+ if (true) {
4411
+ _fingerprintString(ctx, "objtype");
4412
+ _fingerprintString(ctx, _enumToStringObjectType(node->objtype));
4413
+ }
4414
+
4415
+ if (node->relation != NULL) {
4416
+ XXH3_state_t* prev = XXH3_createState();
4417
+ XXH64_hash_t hash;
4418
+
4419
+ XXH3_copyState(prev, ctx->xxh_state);
4420
+ _fingerprintString(ctx, "relation");
4421
+
4422
+ hash = XXH3_64bits_digest(ctx->xxh_state);
4423
+ _fingerprintRangeVar(ctx, node->relation, node, "relation", depth + 1);
4424
+ if (hash == XXH3_64bits_digest(ctx->xxh_state)) {
4425
+ XXH3_copyState(ctx->xxh_state, prev);
4426
+ if (ctx->write_tokens)
4427
+ dlist_delete(dlist_tail_node(&ctx->tokens));
4428
+ }
4429
+ XXH3_freeState(prev);
4430
+ }
4431
+
4432
+ }
4433
+
4434
+ static void
4435
+ _fingerprintAlterTableCmd(FingerprintContext *ctx, const AlterTableCmd *node, const void *parent, const char *field_name, unsigned int depth)
4436
+ {
4437
+ if (true) {
4438
+ _fingerprintString(ctx, "behavior");
4439
+ _fingerprintString(ctx, _enumToStringDropBehavior(node->behavior));
4440
+ }
4441
+
4442
+ if (node->def != NULL) {
4443
+ XXH3_state_t* prev = XXH3_createState();
4444
+ XXH64_hash_t hash;
4445
+
4446
+ XXH3_copyState(prev, ctx->xxh_state);
4447
+ _fingerprintString(ctx, "def");
4448
+
4449
+ hash = XXH3_64bits_digest(ctx->xxh_state);
4450
+ _fingerprintNode(ctx, node->def, node, "def", depth + 1);
4451
+ if (hash == XXH3_64bits_digest(ctx->xxh_state)) {
4452
+ XXH3_copyState(ctx->xxh_state, prev);
4453
+ if (ctx->write_tokens)
4454
+ dlist_delete(dlist_tail_node(&ctx->tokens));
4455
+ }
4456
+ XXH3_freeState(prev);
4457
+ }
4458
+
4459
+ if (node->missing_ok) {
4460
+ _fingerprintString(ctx, "missing_ok");
4461
+ _fingerprintString(ctx, "true");
4462
+ }
4463
+
4464
+ if (node->name != NULL) {
4465
+ _fingerprintString(ctx, "name");
4466
+ _fingerprintString(ctx, node->name);
4467
+ }
4468
+
4469
+ if (node->newowner != NULL) {
4146
4470
  XXH3_state_t* prev = XXH3_createState();
4147
4471
  XXH64_hash_t hash;
4148
4472
 
@@ -4379,6 +4703,23 @@ _fingerprintGrantStmt(FingerprintContext *ctx, const GrantStmt *node, const void
4379
4703
  }
4380
4704
  XXH3_freeState(prev);
4381
4705
  }
4706
+ if (node->grantor != NULL) {
4707
+ XXH3_state_t* prev = XXH3_createState();
4708
+ XXH64_hash_t hash;
4709
+
4710
+ XXH3_copyState(prev, ctx->xxh_state);
4711
+ _fingerprintString(ctx, "grantor");
4712
+
4713
+ hash = XXH3_64bits_digest(ctx->xxh_state);
4714
+ _fingerprintRoleSpec(ctx, node->grantor, node, "grantor", depth + 1);
4715
+ if (hash == XXH3_64bits_digest(ctx->xxh_state)) {
4716
+ XXH3_copyState(ctx->xxh_state, prev);
4717
+ if (ctx->write_tokens)
4718
+ dlist_delete(dlist_tail_node(&ctx->tokens));
4719
+ }
4720
+ XXH3_freeState(prev);
4721
+ }
4722
+
4382
4723
  if (node->is_grant) {
4383
4724
  _fingerprintString(ctx, "is_grant");
4384
4725
  _fingerprintString(ctx, "true");
@@ -4550,13 +4891,22 @@ _fingerprintClusterStmt(FingerprintContext *ctx, const ClusterStmt *node, const
4550
4891
  _fingerprintString(ctx, node->indexname);
4551
4892
  }
4552
4893
 
4553
- if (node->options != 0) {
4554
- char buffer[50];
4555
- sprintf(buffer, "%d", node->options);
4556
- _fingerprintString(ctx, "options");
4557
- _fingerprintString(ctx, buffer);
4558
- }
4894
+ if (node->params != NULL && node->params->length > 0) {
4895
+ XXH3_state_t* prev = XXH3_createState();
4896
+ XXH64_hash_t hash;
4897
+
4898
+ XXH3_copyState(prev, ctx->xxh_state);
4899
+ _fingerprintString(ctx, "params");
4559
4900
 
4901
+ hash = XXH3_64bits_digest(ctx->xxh_state);
4902
+ _fingerprintNode(ctx, node->params, node, "params", depth + 1);
4903
+ if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->params) == 1 && linitial(node->params) == NIL)) {
4904
+ XXH3_copyState(ctx->xxh_state, prev);
4905
+ if (ctx->write_tokens)
4906
+ dlist_delete(dlist_tail_node(&ctx->tokens));
4907
+ }
4908
+ XXH3_freeState(prev);
4909
+ }
4560
4910
  if (node->relation != NULL) {
4561
4911
  XXH3_state_t* prev = XXH3_createState();
4562
4912
  XXH64_hash_t hash;
@@ -5135,6 +5485,11 @@ _fingerprintIndexStmt(FingerprintContext *ctx, const IndexStmt *node, const void
5135
5485
  _fingerprintString(ctx, "true");
5136
5486
  }
5137
5487
 
5488
+ if (node->nulls_not_distinct) {
5489
+ _fingerprintString(ctx, "nulls_not_distinct");
5490
+ _fingerprintString(ctx, "true");
5491
+ }
5492
+
5138
5493
  if (node->oldCreateSubid != 0) {
5139
5494
  char buffer[50];
5140
5495
  sprintf(buffer, "%d", node->oldCreateSubid);
@@ -5297,6 +5652,23 @@ _fingerprintCreateFunctionStmt(FingerprintContext *ctx, const CreateFunctionStmt
5297
5652
  XXH3_freeState(prev);
5298
5653
  }
5299
5654
 
5655
+ if (node->sql_body != NULL) {
5656
+ XXH3_state_t* prev = XXH3_createState();
5657
+ XXH64_hash_t hash;
5658
+
5659
+ XXH3_copyState(prev, ctx->xxh_state);
5660
+ _fingerprintString(ctx, "sql_body");
5661
+
5662
+ hash = XXH3_64bits_digest(ctx->xxh_state);
5663
+ _fingerprintNode(ctx, node->sql_body, node, "sql_body", depth + 1);
5664
+ if (hash == XXH3_64bits_digest(ctx->xxh_state)) {
5665
+ XXH3_copyState(ctx->xxh_state, prev);
5666
+ if (ctx->write_tokens)
5667
+ dlist_delete(dlist_tail_node(&ctx->tokens));
5668
+ }
5669
+ XXH3_freeState(prev);
5670
+ }
5671
+
5300
5672
  }
5301
5673
 
5302
5674
  static void
@@ -5869,6 +6241,11 @@ _fingerprintCreateTableAsStmt(FingerprintContext *ctx, const CreateTableAsStmt *
5869
6241
  _fingerprintString(ctx, "true");
5870
6242
  }
5871
6243
 
6244
+ if (true) {
6245
+ _fingerprintString(ctx, "objtype");
6246
+ _fingerprintString(ctx, _enumToStringObjectType(node->objtype));
6247
+ }
6248
+
5872
6249
  if (node->query != NULL) {
5873
6250
  XXH3_state_t* prev = XXH3_createState();
5874
6251
  XXH64_hash_t hash;
@@ -5886,11 +6263,6 @@ _fingerprintCreateTableAsStmt(FingerprintContext *ctx, const CreateTableAsStmt *
5886
6263
  XXH3_freeState(prev);
5887
6264
  }
5888
6265
 
5889
- if (true) {
5890
- _fingerprintString(ctx, "relkind");
5891
- _fingerprintString(ctx, _enumToStringObjectType(node->relkind));
5892
- }
5893
-
5894
6266
  }
5895
6267
 
5896
6268
  static void
@@ -6159,6 +6531,11 @@ _fingerprintCreateTrigStmt(FingerprintContext *ctx, const CreateTrigStmt *node,
6159
6531
  XXH3_freeState(prev);
6160
6532
  }
6161
6533
 
6534
+ if (node->replace) {
6535
+ _fingerprintString(ctx, "replace");
6536
+ _fingerprintString(ctx, "true");
6537
+ }
6538
+
6162
6539
  if (node->row) {
6163
6540
  _fingerprintString(ctx, "row");
6164
6541
  _fingerprintString(ctx, "true");
@@ -6443,11 +6820,6 @@ _fingerprintConstraintsSetStmt(FingerprintContext *ctx, const ConstraintsSetStmt
6443
6820
  static void
6444
6821
  _fingerprintReindexStmt(FingerprintContext *ctx, const ReindexStmt *node, const void *parent, const char *field_name, unsigned int depth)
6445
6822
  {
6446
- if (node->concurrent) {
6447
- _fingerprintString(ctx, "concurrent");
6448
- _fingerprintString(ctx, "true");
6449
- }
6450
-
6451
6823
  if (true) {
6452
6824
  _fingerprintString(ctx, "kind");
6453
6825
  _fingerprintString(ctx, _enumToStringReindexObjectType(node->kind));
@@ -6458,13 +6830,22 @@ _fingerprintReindexStmt(FingerprintContext *ctx, const ReindexStmt *node, const
6458
6830
  _fingerprintString(ctx, node->name);
6459
6831
  }
6460
6832
 
6461
- if (node->options != 0) {
6462
- char buffer[50];
6463
- sprintf(buffer, "%d", node->options);
6464
- _fingerprintString(ctx, "options");
6465
- _fingerprintString(ctx, buffer);
6466
- }
6833
+ if (node->params != NULL && node->params->length > 0) {
6834
+ XXH3_state_t* prev = XXH3_createState();
6835
+ XXH64_hash_t hash;
6836
+
6837
+ XXH3_copyState(prev, ctx->xxh_state);
6838
+ _fingerprintString(ctx, "params");
6467
6839
 
6840
+ hash = XXH3_64bits_digest(ctx->xxh_state);
6841
+ _fingerprintNode(ctx, node->params, node, "params", depth + 1);
6842
+ if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->params) == 1 && linitial(node->params) == NIL)) {
6843
+ XXH3_copyState(ctx->xxh_state, prev);
6844
+ if (ctx->write_tokens)
6845
+ dlist_delete(dlist_tail_node(&ctx->tokens));
6846
+ }
6847
+ XXH3_freeState(prev);
6848
+ }
6468
6849
  if (node->relation != NULL) {
6469
6850
  XXH3_state_t* prev = XXH3_createState();
6470
6851
  XXH64_hash_t hash;
@@ -6563,6 +6944,16 @@ _fingerprintAlterDatabaseStmt(FingerprintContext *ctx, const AlterDatabaseStmt *
6563
6944
  }
6564
6945
  }
6565
6946
 
6947
+ static void
6948
+ _fingerprintAlterDatabaseRefreshCollStmt(FingerprintContext *ctx, const AlterDatabaseRefreshCollStmt *node, const void *parent, const char *field_name, unsigned int depth)
6949
+ {
6950
+ if (node->dbname != NULL) {
6951
+ _fingerprintString(ctx, "dbname");
6952
+ _fingerprintString(ctx, node->dbname);
6953
+ }
6954
+
6955
+ }
6956
+
6566
6957
  static void
6567
6958
  _fingerprintAlterDatabaseSetStmt(FingerprintContext *ctx, const AlterDatabaseSetStmt *node, const void *parent, const char *field_name, unsigned int depth)
6568
6959
  {
@@ -7069,21 +7460,9 @@ _fingerprintDropTableSpaceStmt(FingerprintContext *ctx, const DropTableSpaceStmt
7069
7460
  static void
7070
7461
  _fingerprintAlterObjectDependsStmt(FingerprintContext *ctx, const AlterObjectDependsStmt *node, const void *parent, const char *field_name, unsigned int depth)
7071
7462
  {
7072
- if (node->extname != NULL) {
7073
- XXH3_state_t* prev = XXH3_createState();
7074
- XXH64_hash_t hash;
7075
-
7076
- XXH3_copyState(prev, ctx->xxh_state);
7463
+ if (strlen(node->extname->sval) > 0) {
7077
7464
  _fingerprintString(ctx, "extname");
7078
-
7079
- hash = XXH3_64bits_digest(ctx->xxh_state);
7080
- _fingerprintNode(ctx, node->extname, node, "extname", depth + 1);
7081
- if (hash == XXH3_64bits_digest(ctx->xxh_state)) {
7082
- XXH3_copyState(ctx->xxh_state, prev);
7083
- if (ctx->write_tokens)
7084
- dlist_delete(dlist_tail_node(&ctx->tokens));
7085
- }
7086
- XXH3_freeState(prev);
7465
+ _fingerprintString(ctx, node->extname->sval);
7087
7466
  }
7088
7467
 
7089
7468
  if (node->object != NULL) {
@@ -8657,16 +9036,16 @@ _fingerprintCreatePublicationStmt(FingerprintContext *ctx, const CreatePublicati
8657
9036
  _fingerprintString(ctx, node->pubname);
8658
9037
  }
8659
9038
 
8660
- if (node->tables != NULL && node->tables->length > 0) {
9039
+ if (node->pubobjects != NULL && node->pubobjects->length > 0) {
8661
9040
  XXH3_state_t* prev = XXH3_createState();
8662
9041
  XXH64_hash_t hash;
8663
9042
 
8664
9043
  XXH3_copyState(prev, ctx->xxh_state);
8665
- _fingerprintString(ctx, "tables");
9044
+ _fingerprintString(ctx, "pubobjects");
8666
9045
 
8667
9046
  hash = XXH3_64bits_digest(ctx->xxh_state);
8668
- _fingerprintNode(ctx, node->tables, node, "tables", depth + 1);
8669
- if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->tables) == 1 && linitial(node->tables) == NIL)) {
9047
+ _fingerprintNode(ctx, node->pubobjects, node, "pubobjects", depth + 1);
9048
+ if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->pubobjects) == 1 && linitial(node->pubobjects) == NIL)) {
8670
9049
  XXH3_copyState(ctx->xxh_state, prev);
8671
9050
  if (ctx->write_tokens)
8672
9051
  dlist_delete(dlist_tail_node(&ctx->tokens));
@@ -8678,6 +9057,11 @@ _fingerprintCreatePublicationStmt(FingerprintContext *ctx, const CreatePublicati
8678
9057
  static void
8679
9058
  _fingerprintAlterPublicationStmt(FingerprintContext *ctx, const AlterPublicationStmt *node, const void *parent, const char *field_name, unsigned int depth)
8680
9059
  {
9060
+ if (true) {
9061
+ _fingerprintString(ctx, "action");
9062
+ _fingerprintString(ctx, _enumToStringAlterPublicationAction(node->action));
9063
+ }
9064
+
8681
9065
  if (node->for_all_tables) {
8682
9066
  _fingerprintString(ctx, "for_all_tables");
8683
9067
  _fingerprintString(ctx, "true");
@@ -8704,21 +9088,16 @@ _fingerprintAlterPublicationStmt(FingerprintContext *ctx, const AlterPublication
8704
9088
  _fingerprintString(ctx, node->pubname);
8705
9089
  }
8706
9090
 
8707
- if (true) {
8708
- _fingerprintString(ctx, "tableAction");
8709
- _fingerprintString(ctx, _enumToStringDefElemAction(node->tableAction));
8710
- }
8711
-
8712
- if (node->tables != NULL && node->tables->length > 0) {
9091
+ if (node->pubobjects != NULL && node->pubobjects->length > 0) {
8713
9092
  XXH3_state_t* prev = XXH3_createState();
8714
9093
  XXH64_hash_t hash;
8715
9094
 
8716
9095
  XXH3_copyState(prev, ctx->xxh_state);
8717
- _fingerprintString(ctx, "tables");
9096
+ _fingerprintString(ctx, "pubobjects");
8718
9097
 
8719
9098
  hash = XXH3_64bits_digest(ctx->xxh_state);
8720
- _fingerprintNode(ctx, node->tables, node, "tables", depth + 1);
8721
- if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->tables) == 1 && linitial(node->tables) == NIL)) {
9099
+ _fingerprintNode(ctx, node->pubobjects, node, "pubobjects", depth + 1);
9100
+ if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->pubobjects) == 1 && linitial(node->pubobjects) == NIL)) {
8722
9101
  XXH3_copyState(ctx->xxh_state, prev);
8723
9102
  if (ctx->write_tokens)
8724
9103
  dlist_delete(dlist_tail_node(&ctx->tokens));
@@ -8923,6 +9302,11 @@ _fingerprintCreateStatsStmt(FingerprintContext *ctx, const CreateStatsStmt *node
8923
9302
  _fingerprintString(ctx, node->stxcomment);
8924
9303
  }
8925
9304
 
9305
+ if (node->transformed) {
9306
+ _fingerprintString(ctx, "transformed");
9307
+ _fingerprintString(ctx, "true");
9308
+ }
9309
+
8926
9310
  }
8927
9311
 
8928
9312
  static void
@@ -8983,6 +9367,22 @@ _fingerprintCallStmt(FingerprintContext *ctx, const CallStmt *node, const void *
8983
9367
  XXH3_freeState(prev);
8984
9368
  }
8985
9369
 
9370
+ if (node->outargs != NULL && node->outargs->length > 0) {
9371
+ XXH3_state_t* prev = XXH3_createState();
9372
+ XXH64_hash_t hash;
9373
+
9374
+ XXH3_copyState(prev, ctx->xxh_state);
9375
+ _fingerprintString(ctx, "outargs");
9376
+
9377
+ hash = XXH3_64bits_digest(ctx->xxh_state);
9378
+ _fingerprintNode(ctx, node->outargs, node, "outargs", depth + 1);
9379
+ if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->outargs) == 1 && linitial(node->outargs) == NIL)) {
9380
+ XXH3_copyState(ctx->xxh_state, prev);
9381
+ if (ctx->write_tokens)
9382
+ dlist_delete(dlist_tail_node(&ctx->tokens));
9383
+ }
9384
+ XXH3_freeState(prev);
9385
+ }
8986
9386
  }
8987
9387
 
8988
9388
  static void
@@ -9112,12 +9512,6 @@ _fingerprintParamRef(FingerprintContext *ctx, const ParamRef *node, const void *
9112
9512
  // Intentionally ignoring all fields for fingerprinting
9113
9513
  }
9114
9514
 
9115
- static void
9116
- _fingerprintA_Const(FingerprintContext *ctx, const A_Const *node, const void *parent, const char *field_name, unsigned int depth)
9117
- {
9118
- // Intentionally ignoring all fields for fingerprinting
9119
- }
9120
-
9121
9515
  static void
9122
9516
  _fingerprintFuncCall(FingerprintContext *ctx, const FuncCall *node, const void *parent, const char *field_name, unsigned int depth)
9123
9517
  {
@@ -9190,6 +9584,11 @@ _fingerprintFuncCall(FingerprintContext *ctx, const FuncCall *node, const void *
9190
9584
  _fingerprintString(ctx, "true");
9191
9585
  }
9192
9586
 
9587
+ if (true) {
9588
+ _fingerprintString(ctx, "funcformat");
9589
+ _fingerprintString(ctx, _enumToStringCoercionForm(node->funcformat));
9590
+ }
9591
+
9193
9592
  if (node->funcname != NULL && node->funcname->length > 0) {
9194
9593
  XXH3_state_t* prev = XXH3_createState();
9195
9594
  XXH64_hash_t hash;
@@ -10104,6 +10503,11 @@ _fingerprintColumnDef(FingerprintContext *ctx, const ColumnDef *node, const void
10104
10503
  _fingerprintString(ctx, node->colname);
10105
10504
  }
10106
10505
 
10506
+ if (node->compression != NULL) {
10507
+ _fingerprintString(ctx, "compression");
10508
+ _fingerprintString(ctx, node->compression);
10509
+ }
10510
+
10107
10511
  if (node->constraints != NULL && node->constraints->length > 0) {
10108
10512
  XXH3_state_t* prev = XXH3_createState();
10109
10513
  XXH64_hash_t hash;
@@ -10339,22 +10743,49 @@ _fingerprintIndexElem(FingerprintContext *ctx, const IndexElem *node, const void
10339
10743
  }
10340
10744
 
10341
10745
  static void
10342
- _fingerprintConstraint(FingerprintContext *ctx, const Constraint *node, const void *parent, const char *field_name, unsigned int depth)
10746
+ _fingerprintStatsElem(FingerprintContext *ctx, const StatsElem *node, const void *parent, const char *field_name, unsigned int depth)
10343
10747
  {
10344
- if (node->access_method != NULL) {
10345
- _fingerprintString(ctx, "access_method");
10346
- _fingerprintString(ctx, node->access_method);
10347
- }
10348
-
10349
- if (node->conname != NULL) {
10350
- _fingerprintString(ctx, "conname");
10351
- _fingerprintString(ctx, node->conname);
10352
- }
10748
+ if (node->expr != NULL) {
10749
+ XXH3_state_t* prev = XXH3_createState();
10750
+ XXH64_hash_t hash;
10353
10751
 
10354
- if (true) {
10355
- _fingerprintString(ctx, "contype");
10356
- _fingerprintString(ctx, _enumToStringConstrType(node->contype));
10357
- }
10752
+ XXH3_copyState(prev, ctx->xxh_state);
10753
+ _fingerprintString(ctx, "expr");
10754
+
10755
+ hash = XXH3_64bits_digest(ctx->xxh_state);
10756
+ _fingerprintNode(ctx, node->expr, node, "expr", depth + 1);
10757
+ if (hash == XXH3_64bits_digest(ctx->xxh_state)) {
10758
+ XXH3_copyState(ctx->xxh_state, prev);
10759
+ if (ctx->write_tokens)
10760
+ dlist_delete(dlist_tail_node(&ctx->tokens));
10761
+ }
10762
+ XXH3_freeState(prev);
10763
+ }
10764
+
10765
+ if (node->name != NULL) {
10766
+ _fingerprintString(ctx, "name");
10767
+ _fingerprintString(ctx, node->name);
10768
+ }
10769
+
10770
+ }
10771
+
10772
+ static void
10773
+ _fingerprintConstraint(FingerprintContext *ctx, const Constraint *node, const void *parent, const char *field_name, unsigned int depth)
10774
+ {
10775
+ if (node->access_method != NULL) {
10776
+ _fingerprintString(ctx, "access_method");
10777
+ _fingerprintString(ctx, node->access_method);
10778
+ }
10779
+
10780
+ if (node->conname != NULL) {
10781
+ _fingerprintString(ctx, "conname");
10782
+ _fingerprintString(ctx, node->conname);
10783
+ }
10784
+
10785
+ if (true) {
10786
+ _fingerprintString(ctx, "contype");
10787
+ _fingerprintString(ctx, _enumToStringConstrType(node->contype));
10788
+ }
10358
10789
 
10359
10790
  if (node->cooked_expr != NULL) {
10360
10791
  _fingerprintString(ctx, "cooked_expr");
@@ -10404,6 +10835,22 @@ _fingerprintConstraint(FingerprintContext *ctx, const Constraint *node, const vo
10404
10835
  _fingerprintString(ctx, buffer);
10405
10836
  }
10406
10837
 
10838
+ if (node->fk_del_set_cols != NULL && node->fk_del_set_cols->length > 0) {
10839
+ XXH3_state_t* prev = XXH3_createState();
10840
+ XXH64_hash_t hash;
10841
+
10842
+ XXH3_copyState(prev, ctx->xxh_state);
10843
+ _fingerprintString(ctx, "fk_del_set_cols");
10844
+
10845
+ hash = XXH3_64bits_digest(ctx->xxh_state);
10846
+ _fingerprintNode(ctx, node->fk_del_set_cols, node, "fk_del_set_cols", depth + 1);
10847
+ if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->fk_del_set_cols) == 1 && linitial(node->fk_del_set_cols) == NIL)) {
10848
+ XXH3_copyState(ctx->xxh_state, prev);
10849
+ if (ctx->write_tokens)
10850
+ dlist_delete(dlist_tail_node(&ctx->tokens));
10851
+ }
10852
+ XXH3_freeState(prev);
10853
+ }
10407
10854
  if (node->fk_matchtype != 0) {
10408
10855
  char buffer[2] = {node->fk_matchtype, '\0'};
10409
10856
  _fingerprintString(ctx, "fk_matchtype");
@@ -10481,6 +10928,11 @@ _fingerprintConstraint(FingerprintContext *ctx, const Constraint *node, const vo
10481
10928
  }
10482
10929
  // Intentionally ignoring node->location for fingerprinting
10483
10930
 
10931
+ if (node->nulls_not_distinct) {
10932
+ _fingerprintString(ctx, "nulls_not_distinct");
10933
+ _fingerprintString(ctx, "true");
10934
+ }
10935
+
10484
10936
  if (node->old_conpfeqop != NULL && node->old_conpfeqop->length > 0) {
10485
10937
  XXH3_state_t* prev = XXH3_createState();
10486
10938
  XXH64_hash_t hash;
@@ -10815,6 +11267,23 @@ _fingerprintRangeTblEntry(FingerprintContext *ctx, const RangeTblEntry *node, co
10815
11267
  bms_free(bms);
10816
11268
  }
10817
11269
 
11270
+ if (node->join_using_alias != NULL) {
11271
+ XXH3_state_t* prev = XXH3_createState();
11272
+ XXH64_hash_t hash;
11273
+
11274
+ XXH3_copyState(prev, ctx->xxh_state);
11275
+ _fingerprintString(ctx, "join_using_alias");
11276
+
11277
+ hash = XXH3_64bits_digest(ctx->xxh_state);
11278
+ _fingerprintAlias(ctx, node->join_using_alias, node, "join_using_alias", depth + 1);
11279
+ if (hash == XXH3_64bits_digest(ctx->xxh_state)) {
11280
+ XXH3_copyState(ctx->xxh_state, prev);
11281
+ if (ctx->write_tokens)
11282
+ dlist_delete(dlist_tail_node(&ctx->tokens));
11283
+ }
11284
+ XXH3_freeState(prev);
11285
+ }
11286
+
10818
11287
  if (node->joinaliasvars != NULL && node->joinaliasvars->length > 0) {
10819
11288
  XXH3_state_t* prev = XXH3_createState();
10820
11289
  XXH64_hash_t hash;
@@ -11394,6 +11863,22 @@ _fingerprintWindowClause(FingerprintContext *ctx, const WindowClause *node, cons
11394
11863
  _fingerprintString(ctx, node->refname);
11395
11864
  }
11396
11865
 
11866
+ if (node->runCondition != NULL && node->runCondition->length > 0) {
11867
+ XXH3_state_t* prev = XXH3_createState();
11868
+ XXH64_hash_t hash;
11869
+
11870
+ XXH3_copyState(prev, ctx->xxh_state);
11871
+ _fingerprintString(ctx, "runCondition");
11872
+
11873
+ hash = XXH3_64bits_digest(ctx->xxh_state);
11874
+ _fingerprintNode(ctx, node->runCondition, node, "runCondition", depth + 1);
11875
+ if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->runCondition) == 1 && linitial(node->runCondition) == NIL)) {
11876
+ XXH3_copyState(ctx->xxh_state, prev);
11877
+ if (ctx->write_tokens)
11878
+ dlist_delete(dlist_tail_node(&ctx->tokens));
11879
+ }
11880
+ XXH3_freeState(prev);
11881
+ }
11397
11882
  if (node->startInRangeFunc != 0) {
11398
11883
  char buffer[50];
11399
11884
  sprintf(buffer, "%d", node->startInRangeFunc);
@@ -11451,6 +11936,22 @@ _fingerprintObjectWithArgs(FingerprintContext *ctx, const ObjectWithArgs *node,
11451
11936
  }
11452
11937
  XXH3_freeState(prev);
11453
11938
  }
11939
+ if (node->objfuncargs != NULL && node->objfuncargs->length > 0) {
11940
+ XXH3_state_t* prev = XXH3_createState();
11941
+ XXH64_hash_t hash;
11942
+
11943
+ XXH3_copyState(prev, ctx->xxh_state);
11944
+ _fingerprintString(ctx, "objfuncargs");
11945
+
11946
+ hash = XXH3_64bits_digest(ctx->xxh_state);
11947
+ _fingerprintNode(ctx, node->objfuncargs, node, "objfuncargs", depth + 1);
11948
+ if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->objfuncargs) == 1 && linitial(node->objfuncargs) == NIL)) {
11949
+ XXH3_copyState(ctx->xxh_state, prev);
11950
+ if (ctx->write_tokens)
11951
+ dlist_delete(dlist_tail_node(&ctx->tokens));
11952
+ }
11953
+ XXH3_freeState(prev);
11954
+ }
11454
11955
  if (node->objname != NULL && node->objname->length > 0) {
11455
11956
  XXH3_state_t* prev = XXH3_createState();
11456
11957
  XXH64_hash_t hash;
@@ -11901,6 +12402,134 @@ _fingerprintOnConflictClause(FingerprintContext *ctx, const OnConflictClause *no
11901
12402
 
11902
12403
  }
11903
12404
 
12405
+ static void
12406
+ _fingerprintCTESearchClause(FingerprintContext *ctx, const CTESearchClause *node, const void *parent, const char *field_name, unsigned int depth)
12407
+ {
12408
+ // Intentionally ignoring node->location for fingerprinting
12409
+
12410
+ if (node->search_breadth_first) {
12411
+ _fingerprintString(ctx, "search_breadth_first");
12412
+ _fingerprintString(ctx, "true");
12413
+ }
12414
+
12415
+ if (node->search_col_list != NULL && node->search_col_list->length > 0) {
12416
+ XXH3_state_t* prev = XXH3_createState();
12417
+ XXH64_hash_t hash;
12418
+
12419
+ XXH3_copyState(prev, ctx->xxh_state);
12420
+ _fingerprintString(ctx, "search_col_list");
12421
+
12422
+ hash = XXH3_64bits_digest(ctx->xxh_state);
12423
+ _fingerprintNode(ctx, node->search_col_list, node, "search_col_list", depth + 1);
12424
+ if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->search_col_list) == 1 && linitial(node->search_col_list) == NIL)) {
12425
+ XXH3_copyState(ctx->xxh_state, prev);
12426
+ if (ctx->write_tokens)
12427
+ dlist_delete(dlist_tail_node(&ctx->tokens));
12428
+ }
12429
+ XXH3_freeState(prev);
12430
+ }
12431
+ if (node->search_seq_column != NULL) {
12432
+ _fingerprintString(ctx, "search_seq_column");
12433
+ _fingerprintString(ctx, node->search_seq_column);
12434
+ }
12435
+
12436
+ }
12437
+
12438
+ static void
12439
+ _fingerprintCTECycleClause(FingerprintContext *ctx, const CTECycleClause *node, const void *parent, const char *field_name, unsigned int depth)
12440
+ {
12441
+ if (node->cycle_col_list != NULL && node->cycle_col_list->length > 0) {
12442
+ XXH3_state_t* prev = XXH3_createState();
12443
+ XXH64_hash_t hash;
12444
+
12445
+ XXH3_copyState(prev, ctx->xxh_state);
12446
+ _fingerprintString(ctx, "cycle_col_list");
12447
+
12448
+ hash = XXH3_64bits_digest(ctx->xxh_state);
12449
+ _fingerprintNode(ctx, node->cycle_col_list, node, "cycle_col_list", depth + 1);
12450
+ if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->cycle_col_list) == 1 && linitial(node->cycle_col_list) == NIL)) {
12451
+ XXH3_copyState(ctx->xxh_state, prev);
12452
+ if (ctx->write_tokens)
12453
+ dlist_delete(dlist_tail_node(&ctx->tokens));
12454
+ }
12455
+ XXH3_freeState(prev);
12456
+ }
12457
+ if (node->cycle_mark_collation != 0) {
12458
+ char buffer[50];
12459
+ sprintf(buffer, "%d", node->cycle_mark_collation);
12460
+ _fingerprintString(ctx, "cycle_mark_collation");
12461
+ _fingerprintString(ctx, buffer);
12462
+ }
12463
+
12464
+ if (node->cycle_mark_column != NULL) {
12465
+ _fingerprintString(ctx, "cycle_mark_column");
12466
+ _fingerprintString(ctx, node->cycle_mark_column);
12467
+ }
12468
+
12469
+ if (node->cycle_mark_default != NULL) {
12470
+ XXH3_state_t* prev = XXH3_createState();
12471
+ XXH64_hash_t hash;
12472
+
12473
+ XXH3_copyState(prev, ctx->xxh_state);
12474
+ _fingerprintString(ctx, "cycle_mark_default");
12475
+
12476
+ hash = XXH3_64bits_digest(ctx->xxh_state);
12477
+ _fingerprintNode(ctx, node->cycle_mark_default, node, "cycle_mark_default", depth + 1);
12478
+ if (hash == XXH3_64bits_digest(ctx->xxh_state)) {
12479
+ XXH3_copyState(ctx->xxh_state, prev);
12480
+ if (ctx->write_tokens)
12481
+ dlist_delete(dlist_tail_node(&ctx->tokens));
12482
+ }
12483
+ XXH3_freeState(prev);
12484
+ }
12485
+
12486
+ if (node->cycle_mark_neop != 0) {
12487
+ char buffer[50];
12488
+ sprintf(buffer, "%d", node->cycle_mark_neop);
12489
+ _fingerprintString(ctx, "cycle_mark_neop");
12490
+ _fingerprintString(ctx, buffer);
12491
+ }
12492
+
12493
+ if (node->cycle_mark_type != 0) {
12494
+ char buffer[50];
12495
+ sprintf(buffer, "%d", node->cycle_mark_type);
12496
+ _fingerprintString(ctx, "cycle_mark_type");
12497
+ _fingerprintString(ctx, buffer);
12498
+ }
12499
+
12500
+ if (node->cycle_mark_typmod != 0) {
12501
+ char buffer[50];
12502
+ sprintf(buffer, "%d", node->cycle_mark_typmod);
12503
+ _fingerprintString(ctx, "cycle_mark_typmod");
12504
+ _fingerprintString(ctx, buffer);
12505
+ }
12506
+
12507
+ if (node->cycle_mark_value != NULL) {
12508
+ XXH3_state_t* prev = XXH3_createState();
12509
+ XXH64_hash_t hash;
12510
+
12511
+ XXH3_copyState(prev, ctx->xxh_state);
12512
+ _fingerprintString(ctx, "cycle_mark_value");
12513
+
12514
+ hash = XXH3_64bits_digest(ctx->xxh_state);
12515
+ _fingerprintNode(ctx, node->cycle_mark_value, node, "cycle_mark_value", depth + 1);
12516
+ if (hash == XXH3_64bits_digest(ctx->xxh_state)) {
12517
+ XXH3_copyState(ctx->xxh_state, prev);
12518
+ if (ctx->write_tokens)
12519
+ dlist_delete(dlist_tail_node(&ctx->tokens));
12520
+ }
12521
+ XXH3_freeState(prev);
12522
+ }
12523
+
12524
+ if (node->cycle_path_column != NULL) {
12525
+ _fingerprintString(ctx, "cycle_path_column");
12526
+ _fingerprintString(ctx, node->cycle_path_column);
12527
+ }
12528
+
12529
+ // Intentionally ignoring node->location for fingerprinting
12530
+
12531
+ }
12532
+
11904
12533
  static void
11905
12534
  _fingerprintCommonTableExpr(FingerprintContext *ctx, const CommonTableExpr *node, const void *parent, const char *field_name, unsigned int depth)
11906
12535
  {
@@ -12023,8 +12652,111 @@ _fingerprintCommonTableExpr(FingerprintContext *ctx, const CommonTableExpr *node
12023
12652
  _fingerprintString(ctx, buffer);
12024
12653
  }
12025
12654
 
12655
+ if (node->cycle_clause != NULL) {
12656
+ XXH3_state_t* prev = XXH3_createState();
12657
+ XXH64_hash_t hash;
12658
+
12659
+ XXH3_copyState(prev, ctx->xxh_state);
12660
+ _fingerprintString(ctx, "cycle_clause");
12661
+
12662
+ hash = XXH3_64bits_digest(ctx->xxh_state);
12663
+ _fingerprintCTECycleClause(ctx, node->cycle_clause, node, "cycle_clause", depth + 1);
12664
+ if (hash == XXH3_64bits_digest(ctx->xxh_state)) {
12665
+ XXH3_copyState(ctx->xxh_state, prev);
12666
+ if (ctx->write_tokens)
12667
+ dlist_delete(dlist_tail_node(&ctx->tokens));
12668
+ }
12669
+ XXH3_freeState(prev);
12670
+ }
12671
+
12026
12672
  // Intentionally ignoring node->location for fingerprinting
12027
12673
 
12674
+ if (node->search_clause != NULL) {
12675
+ XXH3_state_t* prev = XXH3_createState();
12676
+ XXH64_hash_t hash;
12677
+
12678
+ XXH3_copyState(prev, ctx->xxh_state);
12679
+ _fingerprintString(ctx, "search_clause");
12680
+
12681
+ hash = XXH3_64bits_digest(ctx->xxh_state);
12682
+ _fingerprintCTESearchClause(ctx, node->search_clause, node, "search_clause", depth + 1);
12683
+ if (hash == XXH3_64bits_digest(ctx->xxh_state)) {
12684
+ XXH3_copyState(ctx->xxh_state, prev);
12685
+ if (ctx->write_tokens)
12686
+ dlist_delete(dlist_tail_node(&ctx->tokens));
12687
+ }
12688
+ XXH3_freeState(prev);
12689
+ }
12690
+
12691
+ }
12692
+
12693
+ static void
12694
+ _fingerprintMergeWhenClause(FingerprintContext *ctx, const MergeWhenClause *node, const void *parent, const char *field_name, unsigned int depth)
12695
+ {
12696
+ if (true) {
12697
+ _fingerprintString(ctx, "commandType");
12698
+ _fingerprintString(ctx, _enumToStringCmdType(node->commandType));
12699
+ }
12700
+
12701
+ if (node->condition != NULL) {
12702
+ XXH3_state_t* prev = XXH3_createState();
12703
+ XXH64_hash_t hash;
12704
+
12705
+ XXH3_copyState(prev, ctx->xxh_state);
12706
+ _fingerprintString(ctx, "condition");
12707
+
12708
+ hash = XXH3_64bits_digest(ctx->xxh_state);
12709
+ _fingerprintNode(ctx, node->condition, node, "condition", depth + 1);
12710
+ if (hash == XXH3_64bits_digest(ctx->xxh_state)) {
12711
+ XXH3_copyState(ctx->xxh_state, prev);
12712
+ if (ctx->write_tokens)
12713
+ dlist_delete(dlist_tail_node(&ctx->tokens));
12714
+ }
12715
+ XXH3_freeState(prev);
12716
+ }
12717
+
12718
+ if (node->matched) {
12719
+ _fingerprintString(ctx, "matched");
12720
+ _fingerprintString(ctx, "true");
12721
+ }
12722
+
12723
+ if (true) {
12724
+ _fingerprintString(ctx, "override");
12725
+ _fingerprintString(ctx, _enumToStringOverridingKind(node->override));
12726
+ }
12727
+
12728
+ if (node->targetList != NULL && node->targetList->length > 0) {
12729
+ XXH3_state_t* prev = XXH3_createState();
12730
+ XXH64_hash_t hash;
12731
+
12732
+ XXH3_copyState(prev, ctx->xxh_state);
12733
+ _fingerprintString(ctx, "targetList");
12734
+
12735
+ hash = XXH3_64bits_digest(ctx->xxh_state);
12736
+ _fingerprintNode(ctx, node->targetList, node, "targetList", depth + 1);
12737
+ if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->targetList) == 1 && linitial(node->targetList) == NIL)) {
12738
+ XXH3_copyState(ctx->xxh_state, prev);
12739
+ if (ctx->write_tokens)
12740
+ dlist_delete(dlist_tail_node(&ctx->tokens));
12741
+ }
12742
+ XXH3_freeState(prev);
12743
+ }
12744
+ if (node->values != NULL && node->values->length > 0) {
12745
+ XXH3_state_t* prev = XXH3_createState();
12746
+ XXH64_hash_t hash;
12747
+
12748
+ XXH3_copyState(prev, ctx->xxh_state);
12749
+ _fingerprintString(ctx, "values");
12750
+
12751
+ hash = XXH3_64bits_digest(ctx->xxh_state);
12752
+ _fingerprintNode(ctx, node->values, node, "values", depth + 1);
12753
+ if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->values) == 1 && linitial(node->values) == NIL)) {
12754
+ XXH3_copyState(ctx->xxh_state, prev);
12755
+ if (ctx->write_tokens)
12756
+ dlist_delete(dlist_tail_node(&ctx->tokens));
12757
+ }
12758
+ XXH3_freeState(prev);
12759
+ }
12028
12760
  }
12029
12761
 
12030
12762
  static void
@@ -12282,6 +13014,11 @@ _fingerprintPartitionCmd(FingerprintContext *ctx, const PartitionCmd *node, cons
12282
13014
  XXH3_freeState(prev);
12283
13015
  }
12284
13016
 
13017
+ if (node->concurrent) {
13018
+ _fingerprintString(ctx, "concurrent");
13019
+ _fingerprintString(ctx, "true");
13020
+ }
13021
+
12285
13022
  if (node->name != NULL) {
12286
13023
  XXH3_state_t* prev = XXH3_createState();
12287
13024
  XXH64_hash_t hash;
@@ -12346,6 +13083,95 @@ _fingerprintVacuumRelation(FingerprintContext *ctx, const VacuumRelation *node,
12346
13083
  }
12347
13084
  }
12348
13085
 
13086
+ static void
13087
+ _fingerprintPublicationObjSpec(FingerprintContext *ctx, const PublicationObjSpec *node, const void *parent, const char *field_name, unsigned int depth)
13088
+ {
13089
+ // Intentionally ignoring node->location for fingerprinting
13090
+
13091
+ if (node->name != NULL) {
13092
+ _fingerprintString(ctx, "name");
13093
+ _fingerprintString(ctx, node->name);
13094
+ }
13095
+
13096
+ if (true) {
13097
+ _fingerprintString(ctx, "pubobjtype");
13098
+ _fingerprintString(ctx, _enumToStringPublicationObjSpecType(node->pubobjtype));
13099
+ }
13100
+
13101
+ if (node->pubtable != NULL) {
13102
+ XXH3_state_t* prev = XXH3_createState();
13103
+ XXH64_hash_t hash;
13104
+
13105
+ XXH3_copyState(prev, ctx->xxh_state);
13106
+ _fingerprintString(ctx, "pubtable");
13107
+
13108
+ hash = XXH3_64bits_digest(ctx->xxh_state);
13109
+ _fingerprintPublicationTable(ctx, node->pubtable, node, "pubtable", depth + 1);
13110
+ if (hash == XXH3_64bits_digest(ctx->xxh_state)) {
13111
+ XXH3_copyState(ctx->xxh_state, prev);
13112
+ if (ctx->write_tokens)
13113
+ dlist_delete(dlist_tail_node(&ctx->tokens));
13114
+ }
13115
+ XXH3_freeState(prev);
13116
+ }
13117
+
13118
+ }
13119
+
13120
+ static void
13121
+ _fingerprintPublicationTable(FingerprintContext *ctx, const PublicationTable *node, const void *parent, const char *field_name, unsigned int depth)
13122
+ {
13123
+ if (node->columns != NULL && node->columns->length > 0) {
13124
+ XXH3_state_t* prev = XXH3_createState();
13125
+ XXH64_hash_t hash;
13126
+
13127
+ XXH3_copyState(prev, ctx->xxh_state);
13128
+ _fingerprintString(ctx, "columns");
13129
+
13130
+ hash = XXH3_64bits_digest(ctx->xxh_state);
13131
+ _fingerprintNode(ctx, node->columns, node, "columns", depth + 1);
13132
+ if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->columns) == 1 && linitial(node->columns) == NIL)) {
13133
+ XXH3_copyState(ctx->xxh_state, prev);
13134
+ if (ctx->write_tokens)
13135
+ dlist_delete(dlist_tail_node(&ctx->tokens));
13136
+ }
13137
+ XXH3_freeState(prev);
13138
+ }
13139
+ if (node->relation != NULL) {
13140
+ XXH3_state_t* prev = XXH3_createState();
13141
+ XXH64_hash_t hash;
13142
+
13143
+ XXH3_copyState(prev, ctx->xxh_state);
13144
+ _fingerprintString(ctx, "relation");
13145
+
13146
+ hash = XXH3_64bits_digest(ctx->xxh_state);
13147
+ _fingerprintRangeVar(ctx, node->relation, node, "relation", depth + 1);
13148
+ if (hash == XXH3_64bits_digest(ctx->xxh_state)) {
13149
+ XXH3_copyState(ctx->xxh_state, prev);
13150
+ if (ctx->write_tokens)
13151
+ dlist_delete(dlist_tail_node(&ctx->tokens));
13152
+ }
13153
+ XXH3_freeState(prev);
13154
+ }
13155
+
13156
+ if (node->whereClause != NULL) {
13157
+ XXH3_state_t* prev = XXH3_createState();
13158
+ XXH64_hash_t hash;
13159
+
13160
+ XXH3_copyState(prev, ctx->xxh_state);
13161
+ _fingerprintString(ctx, "whereClause");
13162
+
13163
+ hash = XXH3_64bits_digest(ctx->xxh_state);
13164
+ _fingerprintNode(ctx, node->whereClause, node, "whereClause", depth + 1);
13165
+ if (hash == XXH3_64bits_digest(ctx->xxh_state)) {
13166
+ XXH3_copyState(ctx->xxh_state, prev);
13167
+ if (ctx->write_tokens)
13168
+ dlist_delete(dlist_tail_node(&ctx->tokens));
13169
+ }
13170
+ XXH3_freeState(prev);
13171
+ }
13172
+
13173
+ }
13174
+
12349
13175
  static void
12350
13176
  _fingerprintInlineCodeBlock(FingerprintContext *ctx, const InlineCodeBlock *node, const void *parent, const char *field_name, unsigned int depth)
12351
13177
  {