pg_query 4.2.1 → 5.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (531) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +31 -0
  3. data/README.md +6 -8
  4. data/Rakefile +5 -6
  5. data/ext/pg_query/extconf.rb +14 -4
  6. data/ext/pg_query/include/pg_query.h +27 -3
  7. data/ext/pg_query/include/pg_query_enum_defs.c +311 -149
  8. data/ext/pg_query/include/pg_query_fingerprint_conds.c +545 -489
  9. data/ext/pg_query/include/pg_query_fingerprint_defs.c +5092 -4432
  10. data/ext/pg_query/include/pg_query_outfuncs_conds.c +385 -343
  11. data/ext/pg_query/include/pg_query_outfuncs_defs.c +1294 -1161
  12. data/ext/pg_query/include/pg_query_readfuncs_conds.c +137 -123
  13. data/ext/pg_query/include/pg_query_readfuncs_defs.c +1657 -1496
  14. data/ext/pg_query/include/{access → postgres/access}/amapi.h +3 -1
  15. data/ext/pg_query/include/{access → postgres/access}/attmap.h +5 -3
  16. data/ext/pg_query/include/{access → postgres/access}/attnum.h +1 -1
  17. data/ext/pg_query/include/{access → postgres/access}/clog.h +1 -1
  18. data/ext/pg_query/include/{access → postgres/access}/commit_ts.h +1 -1
  19. data/ext/pg_query/include/{access → postgres/access}/detoast.h +1 -1
  20. data/ext/pg_query/include/{access → postgres/access}/genam.h +7 -5
  21. data/ext/pg_query/include/{access → postgres/access}/gin.h +16 -3
  22. data/ext/pg_query/include/{access → postgres/access}/htup.h +1 -1
  23. data/ext/pg_query/include/{access → postgres/access}/htup_details.h +6 -2
  24. data/ext/pg_query/include/{access → postgres/access}/itup.h +61 -58
  25. data/ext/pg_query/include/{access → postgres/access}/parallel.h +2 -2
  26. data/ext/pg_query/include/{access → postgres/access}/printtup.h +1 -1
  27. data/ext/pg_query/include/{access → postgres/access}/relation.h +1 -1
  28. data/ext/pg_query/include/{access → postgres/access}/relscan.h +1 -1
  29. data/ext/pg_query/include/{access → postgres/access}/rmgrlist.h +2 -2
  30. data/ext/pg_query/include/{access → postgres/access}/sdir.h +12 -3
  31. data/ext/pg_query/include/{access → postgres/access}/skey.h +1 -1
  32. data/ext/pg_query/include/{access → postgres/access}/stratnum.h +1 -1
  33. data/ext/pg_query/include/{access → postgres/access}/sysattr.h +1 -1
  34. data/ext/pg_query/include/{access → postgres/access}/table.h +1 -1
  35. data/ext/pg_query/include/{access → postgres/access}/tableam.h +68 -45
  36. data/ext/pg_query/include/{access → postgres/access}/toast_compression.h +1 -1
  37. data/ext/pg_query/include/{access → postgres/access}/transam.h +1 -1
  38. data/ext/pg_query/include/postgres/access/tsmapi.h +82 -0
  39. data/ext/pg_query/include/{access → postgres/access}/tupconvert.h +5 -2
  40. data/ext/pg_query/include/{access → postgres/access}/tupdesc.h +2 -2
  41. data/ext/pg_query/include/{access → postgres/access}/tupmacs.h +58 -98
  42. data/ext/pg_query/include/{access → postgres/access}/twophase.h +2 -2
  43. data/ext/pg_query/include/{access → postgres/access}/xact.h +25 -18
  44. data/ext/pg_query/include/{access → postgres/access}/xlog.h +15 -16
  45. data/ext/pg_query/include/{access → postgres/access}/xlog_internal.h +100 -62
  46. data/ext/pg_query/include/postgres/access/xlogbackup.h +41 -0
  47. data/ext/pg_query/include/{access → postgres/access}/xlogdefs.h +6 -25
  48. data/ext/pg_query/include/{access → postgres/access}/xlogprefetcher.h +1 -1
  49. data/ext/pg_query/include/{access → postgres/access}/xlogreader.h +7 -6
  50. data/ext/pg_query/include/{access → postgres/access}/xlogrecord.h +17 -5
  51. data/ext/pg_query/include/{access → postgres/access}/xlogrecovery.h +4 -3
  52. data/ext/pg_query/include/postgres/archive/archive_module.h +59 -0
  53. data/ext/pg_query/include/{c.h → postgres/c.h} +144 -156
  54. data/ext/pg_query/include/{catalog → postgres/catalog}/catalog.h +4 -3
  55. data/ext/pg_query/include/{catalog → postgres/catalog}/catversion.h +6 -2
  56. data/ext/pg_query/include/{catalog → postgres/catalog}/dependency.h +5 -4
  57. data/ext/pg_query/include/{catalog → postgres/catalog}/genbki.h +7 -6
  58. data/ext/pg_query/include/{catalog → postgres/catalog}/index.h +4 -4
  59. data/ext/pg_query/include/{catalog → postgres/catalog}/indexing.h +1 -1
  60. data/ext/pg_query/include/{catalog → postgres/catalog}/namespace.h +2 -2
  61. data/ext/pg_query/include/{catalog → postgres/catalog}/objectaccess.h +10 -8
  62. data/ext/pg_query/include/{catalog → postgres/catalog}/objectaddress.h +3 -3
  63. data/ext/pg_query/include/{catalog → postgres/catalog}/pg_aggregate.h +1 -1
  64. data/ext/pg_query/include/{catalog → postgres/catalog}/pg_aggregate_d.h +1 -1
  65. data/ext/pg_query/include/{catalog → postgres/catalog}/pg_am.h +1 -1
  66. data/ext/pg_query/include/{catalog → postgres/catalog}/pg_am_d.h +1 -1
  67. data/ext/pg_query/include/{catalog → postgres/catalog}/pg_attribute.h +19 -17
  68. data/ext/pg_query/include/{catalog → postgres/catalog}/pg_attribute_d.h +19 -19
  69. data/ext/pg_query/include/{catalog → postgres/catalog}/pg_authid.h +1 -1
  70. data/ext/pg_query/include/{catalog → postgres/catalog}/pg_authid_d.h +3 -1
  71. data/ext/pg_query/include/{catalog → postgres/catalog}/pg_class.h +1 -1
  72. data/ext/pg_query/include/{catalog → postgres/catalog}/pg_class_d.h +1 -1
  73. data/ext/pg_query/include/{catalog → postgres/catalog}/pg_collation.h +3 -1
  74. data/ext/pg_query/include/{catalog → postgres/catalog}/pg_collation_d.h +4 -3
  75. data/ext/pg_query/include/{catalog → postgres/catalog}/pg_constraint.h +2 -2
  76. data/ext/pg_query/include/{catalog → postgres/catalog}/pg_constraint_d.h +1 -1
  77. data/ext/pg_query/include/{catalog → postgres/catalog}/pg_control.h +9 -1
  78. data/ext/pg_query/include/{catalog → postgres/catalog}/pg_conversion.h +2 -2
  79. data/ext/pg_query/include/{catalog → postgres/catalog}/pg_conversion_d.h +1 -1
  80. data/ext/pg_query/include/postgres/catalog/pg_database.h +124 -0
  81. data/ext/pg_query/include/postgres/catalog/pg_database_d.h +52 -0
  82. data/ext/pg_query/include/{catalog → postgres/catalog}/pg_depend.h +1 -1
  83. data/ext/pg_query/include/{catalog → postgres/catalog}/pg_depend_d.h +1 -1
  84. data/ext/pg_query/include/{catalog → postgres/catalog}/pg_event_trigger.h +1 -1
  85. data/ext/pg_query/include/{catalog → postgres/catalog}/pg_event_trigger_d.h +1 -1
  86. data/ext/pg_query/include/{catalog → postgres/catalog}/pg_index.h +1 -1
  87. data/ext/pg_query/include/{catalog → postgres/catalog}/pg_index_d.h +1 -1
  88. data/ext/pg_query/include/{catalog → postgres/catalog}/pg_language.h +1 -1
  89. data/ext/pg_query/include/{catalog → postgres/catalog}/pg_language_d.h +1 -1
  90. data/ext/pg_query/include/{catalog → postgres/catalog}/pg_namespace.h +1 -1
  91. data/ext/pg_query/include/{catalog → postgres/catalog}/pg_namespace_d.h +1 -1
  92. data/ext/pg_query/include/{catalog → postgres/catalog}/pg_opclass.h +1 -1
  93. data/ext/pg_query/include/{catalog → postgres/catalog}/pg_opclass_d.h +1 -1
  94. data/ext/pg_query/include/{catalog → postgres/catalog}/pg_operator.h +1 -1
  95. data/ext/pg_query/include/{catalog → postgres/catalog}/pg_operator_d.h +1 -1
  96. data/ext/pg_query/include/{catalog → postgres/catalog}/pg_opfamily.h +3 -2
  97. data/ext/pg_query/include/{catalog → postgres/catalog}/pg_opfamily_d.h +4 -2
  98. data/ext/pg_query/include/{catalog → postgres/catalog}/pg_partitioned_table.h +1 -1
  99. data/ext/pg_query/include/{catalog → postgres/catalog}/pg_partitioned_table_d.h +1 -1
  100. data/ext/pg_query/include/{catalog → postgres/catalog}/pg_proc.h +1 -1
  101. data/ext/pg_query/include/{catalog → postgres/catalog}/pg_proc_d.h +1 -1
  102. data/ext/pg_query/include/{catalog → postgres/catalog}/pg_publication.h +2 -5
  103. data/ext/pg_query/include/{catalog → postgres/catalog}/pg_publication_d.h +1 -1
  104. data/ext/pg_query/include/{catalog → postgres/catalog}/pg_replication_origin.h +1 -1
  105. data/ext/pg_query/include/{catalog → postgres/catalog}/pg_replication_origin_d.h +1 -1
  106. data/ext/pg_query/include/{catalog → postgres/catalog}/pg_statistic.h +1 -1
  107. data/ext/pg_query/include/{catalog → postgres/catalog}/pg_statistic_d.h +1 -1
  108. data/ext/pg_query/include/{catalog → postgres/catalog}/pg_statistic_ext.h +1 -1
  109. data/ext/pg_query/include/{catalog → postgres/catalog}/pg_statistic_ext_d.h +1 -1
  110. data/ext/pg_query/include/{catalog → postgres/catalog}/pg_transform.h +1 -1
  111. data/ext/pg_query/include/{catalog → postgres/catalog}/pg_transform_d.h +1 -1
  112. data/ext/pg_query/include/{catalog → postgres/catalog}/pg_trigger.h +1 -1
  113. data/ext/pg_query/include/{catalog → postgres/catalog}/pg_trigger_d.h +1 -1
  114. data/ext/pg_query/include/{catalog → postgres/catalog}/pg_ts_config.h +1 -1
  115. data/ext/pg_query/include/{catalog → postgres/catalog}/pg_ts_config_d.h +1 -1
  116. data/ext/pg_query/include/{catalog → postgres/catalog}/pg_ts_dict.h +1 -1
  117. data/ext/pg_query/include/{catalog → postgres/catalog}/pg_ts_dict_d.h +1 -1
  118. data/ext/pg_query/include/{catalog → postgres/catalog}/pg_ts_parser.h +1 -1
  119. data/ext/pg_query/include/{catalog → postgres/catalog}/pg_ts_parser_d.h +1 -1
  120. data/ext/pg_query/include/{catalog → postgres/catalog}/pg_ts_template.h +1 -1
  121. data/ext/pg_query/include/{catalog → postgres/catalog}/pg_ts_template_d.h +1 -1
  122. data/ext/pg_query/include/{catalog → postgres/catalog}/pg_type.h +1 -1
  123. data/ext/pg_query/include/{catalog → postgres/catalog}/pg_type_d.h +1 -1
  124. data/ext/pg_query/include/{catalog → postgres/catalog}/storage.h +6 -6
  125. data/ext/pg_query/include/{commands → postgres/commands}/async.h +1 -1
  126. data/ext/pg_query/include/{commands → postgres/commands}/dbcommands.h +2 -1
  127. data/ext/pg_query/include/{commands → postgres/commands}/defrem.h +2 -1
  128. data/ext/pg_query/include/{commands → postgres/commands}/event_trigger.h +1 -1
  129. data/ext/pg_query/include/{commands → postgres/commands}/explain.h +3 -1
  130. data/ext/pg_query/include/{commands → postgres/commands}/prepare.h +1 -1
  131. data/ext/pg_query/include/{commands → postgres/commands}/tablespace.h +4 -4
  132. data/ext/pg_query/include/{commands → postgres/commands}/trigger.h +15 -14
  133. data/ext/pg_query/include/{commands → postgres/commands}/user.h +9 -3
  134. data/ext/pg_query/include/{commands → postgres/commands}/vacuum.h +60 -14
  135. data/ext/pg_query/include/postgres/common/cryptohash.h +39 -0
  136. data/ext/pg_query/include/{common → postgres/common}/file_perm.h +1 -1
  137. data/ext/pg_query/include/{common → postgres/common}/hashfn.h +1 -1
  138. data/ext/pg_query/include/postgres/common/int.h +437 -0
  139. data/ext/pg_query/include/{common → postgres/common}/keywords.h +1 -1
  140. data/ext/pg_query/include/{common → postgres/common}/kwlookup.h +2 -2
  141. data/ext/pg_query/include/{common → postgres/common}/pg_prng.h +3 -2
  142. data/ext/pg_query/include/{common → postgres/common}/relpath.h +20 -13
  143. data/ext/pg_query/include/postgres/common/scram-common.h +70 -0
  144. data/ext/pg_query/include/postgres/common/sha2.h +32 -0
  145. data/ext/pg_query/include/{common → postgres/common}/string.h +5 -3
  146. data/ext/pg_query/include/{common → postgres/common}/unicode_east_asian_fw_table.h +10 -10
  147. data/ext/pg_query/include/{common/unicode_combining_table.h → postgres/common/unicode_nonspacing_table.h} +31 -13
  148. data/ext/pg_query/include/postgres/copyfuncs.funcs.c +5013 -0
  149. data/ext/pg_query/include/postgres/copyfuncs.switch.c +938 -0
  150. data/ext/pg_query/include/{datatype → postgres/datatype}/timestamp.h +11 -4
  151. data/ext/pg_query/include/postgres/equalfuncs.funcs.c +3097 -0
  152. data/ext/pg_query/include/postgres/equalfuncs.switch.c +785 -0
  153. data/ext/pg_query/include/{executor → postgres/executor}/execdesc.h +1 -1
  154. data/ext/pg_query/include/{executor → postgres/executor}/executor.h +34 -17
  155. data/ext/pg_query/include/{executor → postgres/executor}/functions.h +1 -1
  156. data/ext/pg_query/include/{executor → postgres/executor}/instrument.h +1 -1
  157. data/ext/pg_query/include/{executor → postgres/executor}/spi.h +2 -2
  158. data/ext/pg_query/include/{executor → postgres/executor}/tablefunc.h +1 -1
  159. data/ext/pg_query/include/{executor → postgres/executor}/tuptable.h +18 -11
  160. data/ext/pg_query/include/{fmgr.h → postgres/fmgr.h} +21 -2
  161. data/ext/pg_query/include/postgres/foreign/fdwapi.h +294 -0
  162. data/ext/pg_query/include/{funcapi.h → postgres/funcapi.h} +12 -12
  163. data/ext/pg_query/include/postgres/gram.h +1127 -0
  164. data/ext/pg_query/include/{parser → postgres}/gramparse.h +4 -4
  165. data/ext/pg_query/include/{jit → postgres/jit}/jit.h +2 -2
  166. data/ext/pg_query/include/postgres/kwlist_d.h +1119 -0
  167. data/ext/pg_query/include/{lib → postgres/lib}/dshash.h +4 -1
  168. data/ext/pg_query/include/{lib → postgres/lib}/ilist.h +435 -22
  169. data/ext/pg_query/include/{lib → postgres/lib}/pairingheap.h +1 -1
  170. data/ext/pg_query/include/{lib → postgres/lib}/simplehash.h +9 -9
  171. data/ext/pg_query/include/{lib → postgres/lib}/sort_template.h +1 -1
  172. data/ext/pg_query/include/{lib → postgres/lib}/stringinfo.h +3 -3
  173. data/ext/pg_query/include/{libpq → postgres/libpq}/auth.h +8 -2
  174. data/ext/pg_query/include/{libpq → postgres/libpq}/crypt.h +1 -1
  175. data/ext/pg_query/include/{libpq → postgres/libpq}/hba.h +24 -17
  176. data/ext/pg_query/include/{libpq → postgres/libpq}/libpq-be.h +36 -25
  177. data/ext/pg_query/include/{libpq → postgres/libpq}/libpq.h +1 -1
  178. data/ext/pg_query/include/{libpq → postgres/libpq}/pqcomm.h +10 -41
  179. data/ext/pg_query/include/{libpq → postgres/libpq}/pqformat.h +2 -2
  180. data/ext/pg_query/include/{libpq → postgres/libpq}/pqsignal.h +22 -10
  181. data/ext/pg_query/include/postgres/libpq/sasl.h +136 -0
  182. data/ext/pg_query/include/postgres/libpq/scram.h +37 -0
  183. data/ext/pg_query/include/{mb → postgres/mb}/pg_wchar.h +35 -18
  184. data/ext/pg_query/include/{mb → postgres/mb}/stringinfo_mb.h +1 -1
  185. data/ext/pg_query/include/{miscadmin.h → postgres/miscadmin.h} +27 -15
  186. data/ext/pg_query/include/{nodes → postgres/nodes}/bitmapset.h +11 -7
  187. data/ext/pg_query/include/{nodes → postgres/nodes}/execnodes.h +83 -30
  188. data/ext/pg_query/include/{nodes → postgres/nodes}/extensible.h +5 -3
  189. data/ext/pg_query/include/{nodes → postgres/nodes}/lockoptions.h +1 -1
  190. data/ext/pg_query/include/{nodes → postgres/nodes}/makefuncs.h +14 -2
  191. data/ext/pg_query/include/{nodes → postgres/nodes}/memnodes.h +7 -4
  192. data/ext/pg_query/include/postgres/nodes/miscnodes.h +56 -0
  193. data/ext/pg_query/include/{nodes → postgres/nodes}/nodeFuncs.h +89 -29
  194. data/ext/pg_query/include/{nodes → postgres/nodes}/nodes.h +96 -511
  195. data/ext/pg_query/include/postgres/nodes/nodetags.h +471 -0
  196. data/ext/pg_query/include/{nodes → postgres/nodes}/params.h +3 -3
  197. data/ext/pg_query/include/{nodes → postgres/nodes}/parsenodes.h +377 -139
  198. data/ext/pg_query/include/{nodes → postgres/nodes}/pathnodes.h +1090 -440
  199. data/ext/pg_query/include/{nodes → postgres/nodes}/pg_list.h +30 -7
  200. data/ext/pg_query/include/{nodes → postgres/nodes}/plannodes.h +367 -124
  201. data/ext/pg_query/include/{nodes → postgres/nodes}/primnodes.h +670 -222
  202. data/ext/pg_query/include/{nodes → postgres/nodes}/print.h +1 -1
  203. data/ext/pg_query/include/{utils → postgres/nodes}/queryjumble.h +5 -7
  204. data/ext/pg_query/include/postgres/nodes/replnodes.h +111 -0
  205. data/ext/pg_query/include/postgres/nodes/supportnodes.h +346 -0
  206. data/ext/pg_query/include/{nodes → postgres/nodes}/tidbitmap.h +1 -1
  207. data/ext/pg_query/include/{nodes → postgres/nodes}/value.h +12 -2
  208. data/ext/pg_query/include/{optimizer → postgres/optimizer}/cost.h +6 -4
  209. data/ext/pg_query/include/{optimizer → postgres/optimizer}/geqo.h +1 -1
  210. data/ext/pg_query/include/{optimizer → postgres/optimizer}/geqo_gene.h +1 -1
  211. data/ext/pg_query/include/{optimizer → postgres/optimizer}/optimizer.h +8 -8
  212. data/ext/pg_query/include/{optimizer → postgres/optimizer}/paths.h +16 -7
  213. data/ext/pg_query/include/{optimizer → postgres/optimizer}/planmain.h +3 -6
  214. data/ext/pg_query/include/{parser → postgres/parser}/analyze.h +4 -3
  215. data/ext/pg_query/include/{parser → postgres/parser}/kwlist.h +12 -1
  216. data/ext/pg_query/include/{parser → postgres/parser}/parse_agg.h +4 -2
  217. data/ext/pg_query/include/{parser → postgres/parser}/parse_coerce.h +3 -1
  218. data/ext/pg_query/include/{parser → postgres/parser}/parse_expr.h +1 -1
  219. data/ext/pg_query/include/{parser → postgres/parser}/parse_func.h +1 -1
  220. data/ext/pg_query/include/{parser → postgres/parser}/parse_node.h +22 -4
  221. data/ext/pg_query/include/{parser → postgres/parser}/parse_oper.h +3 -3
  222. data/ext/pg_query/include/{parser → postgres/parser}/parse_relation.h +8 -3
  223. data/ext/pg_query/include/{parser → postgres/parser}/parse_type.h +4 -3
  224. data/ext/pg_query/include/{parser → postgres/parser}/parser.h +4 -4
  225. data/ext/pg_query/include/{parser → postgres/parser}/parsetree.h +1 -1
  226. data/ext/pg_query/include/{parser → postgres/parser}/scanner.h +2 -2
  227. data/ext/pg_query/include/{parser → postgres/parser}/scansup.h +1 -1
  228. data/ext/pg_query/include/{partitioning → postgres/partitioning}/partdefs.h +1 -1
  229. data/ext/pg_query/include/{pg_config.h → postgres/pg_config.h} +158 -218
  230. data/ext/pg_query/include/{pg_config_manual.h → postgres/pg_config_manual.h} +8 -46
  231. data/ext/pg_query/include/postgres/pg_config_os.h +8 -0
  232. data/ext/pg_query/include/{pg_getopt.h → postgres/pg_getopt.h} +1 -1
  233. data/ext/pg_query/include/{pg_trace.h → postgres/pg_trace.h} +1 -1
  234. data/ext/pg_query/include/{pgstat.h → postgres/pgstat.h} +173 -94
  235. data/ext/pg_query/include/{pgtime.h → postgres/pgtime.h} +3 -3
  236. data/ext/pg_query/include/{pl_gram.h → postgres/pl_gram.h} +66 -64
  237. data/ext/pg_query/include/{pl_reserved_kwlist.h → postgres/pl_reserved_kwlist.h} +1 -1
  238. data/ext/pg_query/include/{pl_reserved_kwlist_d.h → postgres/pl_reserved_kwlist_d.h} +1 -1
  239. data/ext/pg_query/include/{pl_unreserved_kwlist.h → postgres/pl_unreserved_kwlist.h} +2 -1
  240. data/ext/pg_query/include/{pl_unreserved_kwlist_d.h → postgres/pl_unreserved_kwlist_d.h} +48 -46
  241. data/ext/pg_query/include/{plpgsql.h → postgres/plpgsql.h} +28 -33
  242. data/ext/pg_query/include/{port → postgres/port}/atomics/arch-arm.h +3 -3
  243. data/ext/pg_query/include/postgres/port/atomics/arch-hppa.h +17 -0
  244. data/ext/pg_query/include/{port → postgres/port}/atomics/arch-ppc.h +21 -21
  245. data/ext/pg_query/include/{port → postgres/port}/atomics/arch-x86.h +2 -2
  246. data/ext/pg_query/include/{port → postgres/port}/atomics/fallback.h +3 -3
  247. data/ext/pg_query/include/{port → postgres/port}/atomics/generic-gcc.h +1 -1
  248. data/ext/pg_query/include/postgres/port/atomics/generic-msvc.h +101 -0
  249. data/ext/pg_query/include/postgres/port/atomics/generic-sunpro.h +106 -0
  250. data/ext/pg_query/include/{port → postgres/port}/atomics/generic.h +1 -1
  251. data/ext/pg_query/include/{port → postgres/port}/atomics.h +2 -7
  252. data/ext/pg_query/include/{port → postgres/port}/pg_bitutils.h +62 -25
  253. data/ext/pg_query/include/{port → postgres/port}/pg_bswap.h +1 -1
  254. data/ext/pg_query/include/{port → postgres/port}/pg_crc32c.h +1 -1
  255. data/ext/pg_query/include/postgres/port/simd.h +375 -0
  256. data/ext/pg_query/include/postgres/port/win32/arpa/inet.h +3 -0
  257. data/ext/pg_query/include/postgres/port/win32/dlfcn.h +1 -0
  258. data/ext/pg_query/include/postgres/port/win32/grp.h +1 -0
  259. data/ext/pg_query/include/postgres/port/win32/netdb.h +7 -0
  260. data/ext/pg_query/include/postgres/port/win32/netinet/in.h +3 -0
  261. data/ext/pg_query/include/postgres/port/win32/netinet/tcp.h +7 -0
  262. data/ext/pg_query/include/postgres/port/win32/pwd.h +3 -0
  263. data/ext/pg_query/include/postgres/port/win32/sys/resource.h +20 -0
  264. data/ext/pg_query/include/postgres/port/win32/sys/select.h +3 -0
  265. data/ext/pg_query/include/postgres/port/win32/sys/socket.h +26 -0
  266. data/ext/pg_query/include/postgres/port/win32/sys/un.h +17 -0
  267. data/ext/pg_query/include/postgres/port/win32/sys/wait.h +3 -0
  268. data/ext/pg_query/include/postgres/port/win32.h +59 -0
  269. data/ext/pg_query/include/postgres/port/win32_msvc/dirent.h +34 -0
  270. data/ext/pg_query/include/postgres/port/win32_msvc/sys/file.h +1 -0
  271. data/ext/pg_query/include/postgres/port/win32_msvc/sys/param.h +1 -0
  272. data/ext/pg_query/include/postgres/port/win32_msvc/sys/time.h +1 -0
  273. data/ext/pg_query/include/postgres/port/win32_msvc/unistd.h +9 -0
  274. data/ext/pg_query/include/postgres/port/win32_msvc/utime.h +3 -0
  275. data/ext/pg_query/include/postgres/port/win32_port.h +594 -0
  276. data/ext/pg_query/include/{port.h → postgres/port.h} +42 -75
  277. data/ext/pg_query/include/postgres/portability/instr_time.h +197 -0
  278. data/ext/pg_query/include/postgres/postgres.h +579 -0
  279. data/ext/pg_query/include/{postgres_ext.h → postgres/postgres_ext.h} +0 -1
  280. data/ext/pg_query/include/{postmaster → postgres/postmaster}/autovacuum.h +1 -4
  281. data/ext/pg_query/include/{postmaster → postgres/postmaster}/bgworker.h +2 -2
  282. data/ext/pg_query/include/{postmaster → postgres/postmaster}/bgworker_internals.h +1 -1
  283. data/ext/pg_query/include/{postmaster → postgres/postmaster}/bgwriter.h +2 -2
  284. data/ext/pg_query/include/{postmaster → postgres/postmaster}/interrupt.h +1 -1
  285. data/ext/pg_query/include/postgres/postmaster/pgarch.h +36 -0
  286. data/ext/pg_query/include/{postmaster → postgres/postmaster}/postmaster.h +6 -3
  287. data/ext/pg_query/include/{postmaster → postgres/postmaster}/startup.h +3 -1
  288. data/ext/pg_query/include/{postmaster → postgres/postmaster}/syslogger.h +2 -2
  289. data/ext/pg_query/include/{postmaster → postgres/postmaster}/walwriter.h +3 -1
  290. data/ext/pg_query/include/{regex → postgres/regex}/regex.h +9 -6
  291. data/ext/pg_query/include/{replication → postgres/replication}/logicallauncher.h +6 -1
  292. data/ext/pg_query/include/{replication → postgres/replication}/logicalproto.h +30 -10
  293. data/ext/pg_query/include/postgres/replication/logicalworker.h +32 -0
  294. data/ext/pg_query/include/{replication → postgres/replication}/origin.h +4 -4
  295. data/ext/pg_query/include/{replication → postgres/replication}/reorderbuffer.h +113 -45
  296. data/ext/pg_query/include/{replication → postgres/replication}/slot.h +25 -6
  297. data/ext/pg_query/include/{replication → postgres/replication}/syncrep.h +2 -8
  298. data/ext/pg_query/include/{replication → postgres/replication}/walreceiver.h +15 -9
  299. data/ext/pg_query/include/{replication → postgres/replication}/walsender.h +13 -13
  300. data/ext/pg_query/include/{rewrite → postgres/rewrite}/prs2lock.h +1 -1
  301. data/ext/pg_query/include/{rewrite → postgres/rewrite}/rewriteHandler.h +1 -4
  302. data/ext/pg_query/include/{rewrite → postgres/rewrite}/rewriteManip.h +11 -2
  303. data/ext/pg_query/include/{rewrite → postgres/rewrite}/rewriteSupport.h +1 -1
  304. data/ext/pg_query/include/{storage → postgres/storage}/backendid.h +1 -1
  305. data/ext/pg_query/include/{storage → postgres/storage}/block.h +24 -31
  306. data/ext/pg_query/include/{storage → postgres/storage}/buf.h +1 -1
  307. data/ext/pg_query/include/{storage → postgres/storage}/bufmgr.h +183 -87
  308. data/ext/pg_query/include/{storage → postgres/storage}/bufpage.h +146 -93
  309. data/ext/pg_query/include/{storage → postgres/storage}/condition_variable.h +2 -2
  310. data/ext/pg_query/include/{storage → postgres/storage}/dsm.h +3 -6
  311. data/ext/pg_query/include/{storage → postgres/storage}/dsm_impl.h +4 -1
  312. data/ext/pg_query/include/{storage → postgres/storage}/fd.h +24 -20
  313. data/ext/pg_query/include/{storage → postgres/storage}/fileset.h +1 -1
  314. data/ext/pg_query/include/{storage → postgres/storage}/ipc.h +2 -2
  315. data/ext/pg_query/include/{storage → postgres/storage}/item.h +1 -1
  316. data/ext/pg_query/include/{storage → postgres/storage}/itemid.h +1 -1
  317. data/ext/pg_query/include/{storage → postgres/storage}/itemptr.h +94 -57
  318. data/ext/pg_query/include/{storage → postgres/storage}/large_object.h +1 -1
  319. data/ext/pg_query/include/{storage → postgres/storage}/latch.h +9 -1
  320. data/ext/pg_query/include/{storage → postgres/storage}/lmgr.h +6 -1
  321. data/ext/pg_query/include/{storage → postgres/storage}/lock.h +21 -13
  322. data/ext/pg_query/include/{storage → postgres/storage}/lockdefs.h +3 -3
  323. data/ext/pg_query/include/{storage → postgres/storage}/lwlock.h +16 -2
  324. data/ext/pg_query/include/{storage → postgres/storage}/off.h +1 -1
  325. data/ext/pg_query/include/{storage → postgres/storage}/pg_sema.h +1 -1
  326. data/ext/pg_query/include/{storage → postgres/storage}/pg_shmem.h +1 -1
  327. data/ext/pg_query/include/{storage → postgres/storage}/pmsignal.h +1 -1
  328. data/ext/pg_query/include/{storage → postgres/storage}/predicate.h +2 -2
  329. data/ext/pg_query/include/{storage → postgres/storage}/proc.h +22 -17
  330. data/ext/pg_query/include/{storage → postgres/storage}/procarray.h +3 -2
  331. data/ext/pg_query/include/{storage → postgres/storage}/proclist_types.h +1 -1
  332. data/ext/pg_query/include/{storage → postgres/storage}/procsignal.h +3 -1
  333. data/ext/pg_query/include/postgres/storage/relfilelocator.h +99 -0
  334. data/ext/pg_query/include/{storage → postgres/storage}/s_lock.h +66 -309
  335. data/ext/pg_query/include/{storage → postgres/storage}/sharedfileset.h +1 -1
  336. data/ext/pg_query/include/{storage → postgres/storage}/shm_mq.h +1 -1
  337. data/ext/pg_query/include/{storage → postgres/storage}/shm_toc.h +1 -1
  338. data/ext/pg_query/include/{storage → postgres/storage}/shmem.h +1 -23
  339. data/ext/pg_query/include/{storage → postgres/storage}/sinval.h +3 -3
  340. data/ext/pg_query/include/{storage → postgres/storage}/sinvaladt.h +4 -2
  341. data/ext/pg_query/include/{storage → postgres/storage}/smgr.h +12 -10
  342. data/ext/pg_query/include/{storage → postgres/storage}/spin.h +1 -1
  343. data/ext/pg_query/include/{storage → postgres/storage}/standby.h +9 -8
  344. data/ext/pg_query/include/{storage → postgres/storage}/standbydefs.h +1 -1
  345. data/ext/pg_query/include/{storage → postgres/storage}/sync.h +3 -3
  346. data/ext/pg_query/include/{tcop → postgres/tcop}/cmdtag.h +7 -2
  347. data/ext/pg_query/include/{tcop → postgres/tcop}/cmdtaglist.h +1 -1
  348. data/ext/pg_query/include/{tcop → postgres/tcop}/deparse_utility.h +1 -1
  349. data/ext/pg_query/include/{tcop → postgres/tcop}/dest.h +1 -3
  350. data/ext/pg_query/include/{tcop → postgres/tcop}/fastpath.h +1 -1
  351. data/ext/pg_query/include/{tcop → postgres/tcop}/pquery.h +1 -1
  352. data/ext/pg_query/include/{tcop → postgres/tcop}/tcopprot.h +3 -6
  353. data/ext/pg_query/include/{tcop → postgres/tcop}/utility.h +1 -1
  354. data/ext/pg_query/include/{tsearch → postgres/tsearch}/ts_cache.h +2 -4
  355. data/ext/pg_query/include/{utils → postgres/utils}/acl.h +26 -81
  356. data/ext/pg_query/include/{utils → postgres/utils}/aclchk_internal.h +1 -1
  357. data/ext/pg_query/include/{utils → postgres/utils}/array.h +19 -1
  358. data/ext/pg_query/include/{utils → postgres/utils}/backend_progress.h +2 -1
  359. data/ext/pg_query/include/{utils → postgres/utils}/backend_status.h +24 -3
  360. data/ext/pg_query/include/{utils → postgres/utils}/builtins.h +15 -6
  361. data/ext/pg_query/include/{utils → postgres/utils}/bytea.h +1 -1
  362. data/ext/pg_query/include/{utils → postgres/utils}/catcache.h +1 -1
  363. data/ext/pg_query/include/{utils → postgres/utils}/date.h +37 -9
  364. data/ext/pg_query/include/{utils → postgres/utils}/datetime.h +41 -21
  365. data/ext/pg_query/include/{utils → postgres/utils}/datum.h +1 -1
  366. data/ext/pg_query/include/{utils → postgres/utils}/dsa.h +5 -1
  367. data/ext/pg_query/include/{utils → postgres/utils}/elog.h +104 -29
  368. data/ext/pg_query/include/{utils → postgres/utils}/expandeddatum.h +14 -3
  369. data/ext/pg_query/include/{utils → postgres/utils}/expandedrecord.h +14 -4
  370. data/ext/pg_query/include/{utils → postgres/utils}/float.h +7 -6
  371. data/ext/pg_query/include/{utils → postgres/utils}/fmgroids.h +54 -1
  372. data/ext/pg_query/include/{utils → postgres/utils}/fmgrprotos.h +45 -3
  373. data/ext/pg_query/include/{utils → postgres/utils}/fmgrtab.h +1 -1
  374. data/ext/pg_query/include/{utils → postgres/utils}/guc.h +59 -86
  375. data/ext/pg_query/include/postgres/utils/guc_hooks.h +163 -0
  376. data/ext/pg_query/include/{utils → postgres/utils}/guc_tables.h +49 -3
  377. data/ext/pg_query/include/{utils → postgres/utils}/hsearch.h +1 -1
  378. data/ext/pg_query/include/{utils → postgres/utils}/inval.h +3 -3
  379. data/ext/pg_query/include/postgres/utils/logtape.h +77 -0
  380. data/ext/pg_query/include/{utils → postgres/utils}/lsyscache.h +5 -1
  381. data/ext/pg_query/include/{utils → postgres/utils}/memdebug.h +1 -1
  382. data/ext/pg_query/include/{utils → postgres/utils}/memutils.h +7 -51
  383. data/ext/pg_query/include/postgres/utils/memutils_internal.h +136 -0
  384. data/ext/pg_query/include/postgres/utils/memutils_memorychunk.h +237 -0
  385. data/ext/pg_query/include/{utils → postgres/utils}/numeric.h +20 -5
  386. data/ext/pg_query/include/{utils → postgres/utils}/palloc.h +9 -2
  387. data/ext/pg_query/include/{utils → postgres/utils}/partcache.h +3 -2
  388. data/ext/pg_query/include/{utils → postgres/utils}/pg_locale.h +22 -14
  389. data/ext/pg_query/include/{utils → postgres/utils}/pgstat_internal.h +37 -7
  390. data/ext/pg_query/include/{utils → postgres/utils}/plancache.h +1 -1
  391. data/ext/pg_query/include/{utils → postgres/utils}/portal.h +1 -1
  392. data/ext/pg_query/include/{utils → postgres/utils}/probes.h +6 -6
  393. data/ext/pg_query/include/postgres/utils/ps_status.h +47 -0
  394. data/ext/pg_query/include/{utils → postgres/utils}/queryenvironment.h +1 -1
  395. data/ext/pg_query/include/{utils → postgres/utils}/regproc.h +3 -3
  396. data/ext/pg_query/include/{utils → postgres/utils}/rel.h +60 -43
  397. data/ext/pg_query/include/{utils → postgres/utils}/relcache.h +13 -8
  398. data/ext/pg_query/include/{utils → postgres/utils}/reltrigger.h +1 -1
  399. data/ext/pg_query/include/{utils → postgres/utils}/resowner.h +1 -1
  400. data/ext/pg_query/include/{utils → postgres/utils}/ruleutils.h +6 -1
  401. data/ext/pg_query/include/{utils → postgres/utils}/sharedtuplestore.h +1 -1
  402. data/ext/pg_query/include/{utils → postgres/utils}/snapmgr.h +4 -2
  403. data/ext/pg_query/include/{utils → postgres/utils}/snapshot.h +1 -1
  404. data/ext/pg_query/include/{utils → postgres/utils}/sortsupport.h +2 -2
  405. data/ext/pg_query/include/{utils → postgres/utils}/syscache.h +4 -1
  406. data/ext/pg_query/include/{utils → postgres/utils}/timeout.h +1 -1
  407. data/ext/pg_query/include/{utils → postgres/utils}/timestamp.h +41 -11
  408. data/ext/pg_query/include/{utils → postgres/utils}/tuplesort.h +189 -35
  409. data/ext/pg_query/include/{utils → postgres/utils}/tuplestore.h +1 -1
  410. data/ext/pg_query/include/{utils → postgres/utils}/typcache.h +1 -1
  411. data/ext/pg_query/include/{utils → postgres/utils}/varlena.h +13 -1
  412. data/ext/pg_query/include/{utils → postgres/utils}/wait_event.h +9 -4
  413. data/ext/pg_query/include/{utils → postgres/utils}/xml.h +15 -5
  414. data/ext/pg_query/include/{postgres.h → postgres/varatt.h} +7 -457
  415. data/ext/pg_query/include/protobuf/pg_query.pb-c.h +6186 -5585
  416. data/ext/pg_query/include/protobuf/pg_query.pb.h +112443 -91222
  417. data/ext/pg_query/pg_query.c +10 -1
  418. data/ext/pg_query/pg_query.pb-c.c +19755 -17757
  419. data/ext/pg_query/pg_query_deparse.c +1 -10635
  420. data/ext/pg_query/pg_query_fingerprint.c +12 -8
  421. data/ext/pg_query/pg_query_fingerprint.h +1 -1
  422. data/ext/pg_query/pg_query_internal.h +1 -1
  423. data/ext/pg_query/pg_query_json_plpgsql.c +1 -0
  424. data/ext/pg_query/pg_query_normalize.c +1 -1
  425. data/ext/pg_query/pg_query_outfuncs_json.c +6 -0
  426. data/ext/pg_query/pg_query_outfuncs_protobuf.c +3 -2
  427. data/ext/pg_query/pg_query_parse.c +47 -5
  428. data/ext/pg_query/pg_query_parse_plpgsql.c +7 -5
  429. data/ext/pg_query/pg_query_readfuncs_protobuf.c +1 -0
  430. data/ext/pg_query/pg_query_ruby.c +5 -0
  431. data/ext/pg_query/pg_query_ruby_freebsd.sym +2 -0
  432. data/ext/pg_query/pg_query_scan.c +1 -1
  433. data/ext/pg_query/pg_query_split.c +3 -3
  434. data/ext/pg_query/postgres_deparse.c +11067 -0
  435. data/ext/pg_query/postgres_deparse.h +9 -0
  436. data/ext/pg_query/src_backend_catalog_namespace.c +7 -2
  437. data/ext/pg_query/src_backend_catalog_pg_proc.c +1 -1
  438. data/ext/pg_query/src_backend_commands_define.c +1 -1
  439. data/ext/pg_query/src_backend_nodes_bitmapset.c +11 -70
  440. data/ext/pg_query/src_backend_nodes_copyfuncs.c +96 -6202
  441. data/ext/pg_query/src_backend_nodes_equalfuncs.c +95 -4068
  442. data/ext/pg_query/src_backend_nodes_extensible.c +6 -29
  443. data/ext/pg_query/src_backend_nodes_list.c +14 -2
  444. data/ext/pg_query/src_backend_nodes_makefuncs.c +95 -1
  445. data/ext/pg_query/src_backend_nodes_nodeFuncs.c +283 -132
  446. data/ext/pg_query/src_backend_nodes_nodes.c +38 -0
  447. data/ext/pg_query/src_backend_nodes_value.c +1 -1
  448. data/ext/pg_query/src_backend_parser_gram.c +33208 -31806
  449. data/ext/pg_query/src_backend_parser_parser.c +28 -2
  450. data/ext/pg_query/src_backend_parser_scan.c +4318 -3329
  451. data/ext/pg_query/src_backend_parser_scansup.c +1 -1
  452. data/ext/pg_query/src_backend_storage_ipc_ipc.c +1 -1
  453. data/ext/pg_query/src_backend_tcop_postgres.c +66 -87
  454. data/ext/pg_query/src_backend_utils_activity_pgstat_database.c +1 -1
  455. data/ext/pg_query/src_backend_utils_adt_datum.c +5 -7
  456. data/ext/pg_query/src_backend_utils_adt_expandeddatum.c +1 -1
  457. data/ext/pg_query/src_backend_utils_adt_format_type.c +1 -1
  458. data/ext/pg_query/src_backend_utils_adt_numutils.c +489 -0
  459. data/ext/pg_query/src_backend_utils_adt_ruleutils.c +79 -5
  460. data/ext/pg_query/src_backend_utils_error_assert.c +4 -7
  461. data/ext/pg_query/src_backend_utils_error_elog.c +371 -249
  462. data/ext/pg_query/src_backend_utils_fmgr_fmgr.c +33 -1
  463. data/ext/pg_query/src_backend_utils_init_globals.c +6 -3
  464. data/ext/pg_query/src_backend_utils_mb_mbutils.c +21 -67
  465. data/ext/pg_query/src_backend_utils_misc_guc_tables.c +492 -0
  466. data/ext/pg_query/src_backend_utils_mmgr_alignedalloc.c +163 -0
  467. data/ext/pg_query/src_backend_utils_mmgr_aset.c +449 -312
  468. data/ext/pg_query/src_backend_utils_mmgr_generation.c +1039 -0
  469. data/ext/pg_query/src_backend_utils_mmgr_mcxt.c +398 -49
  470. data/ext/pg_query/src_backend_utils_mmgr_slab.c +1021 -0
  471. data/ext/pg_query/src_common_encnames.c +4 -1
  472. data/ext/pg_query/src_common_hashfn.c +1 -1
  473. data/ext/pg_query/src_common_keywords.c +1 -1
  474. data/ext/pg_query/src_common_kwlist_d.h +534 -510
  475. data/ext/pg_query/src_common_kwlookup.c +1 -1
  476. data/ext/pg_query/src_common_psprintf.c +1 -1
  477. data/ext/pg_query/src_common_stringinfo.c +4 -4
  478. data/ext/pg_query/src_common_wchar.c +9 -8
  479. data/ext/pg_query/src_pl_plpgsql_src_pl_comp.c +1 -1
  480. data/ext/pg_query/src_pl_plpgsql_src_pl_funcs.c +3 -1
  481. data/ext/pg_query/src_pl_plpgsql_src_pl_gram.c +661 -694
  482. data/ext/pg_query/src_pl_plpgsql_src_pl_handler.c +1 -1
  483. data/ext/pg_query/src_pl_plpgsql_src_pl_reserved_kwlist_d.h +1 -1
  484. data/ext/pg_query/src_pl_plpgsql_src_pl_scanner.c +1 -1
  485. data/ext/pg_query/src_pl_plpgsql_src_pl_unreserved_kwlist_d.h +48 -46
  486. data/ext/pg_query/src_port_pg_bitutils.c +79 -5
  487. data/ext/pg_query/src_port_pgstrcasecmp.c +29 -1
  488. data/ext/pg_query/src_port_snprintf.c +6 -10
  489. data/ext/pg_query/src_port_strerror.c +1 -1
  490. data/ext/pg_query/src_port_strlcpy.c +79 -0
  491. data/lib/pg_query/fingerprint.rb +2 -3
  492. data/lib/pg_query/node.rb +16 -11
  493. data/lib/pg_query/parse.rb +1 -1
  494. data/lib/pg_query/pg_query_pb.rb +166 -3191
  495. data/lib/pg_query/treewalker.rb +23 -5
  496. data/lib/pg_query/version.rb +1 -1
  497. metadata +432 -380
  498. data/ext/pg_query/guc-file.c +0 -0
  499. data/ext/pg_query/include/catalog/pg_parameter_acl.h +0 -60
  500. data/ext/pg_query/include/catalog/pg_parameter_acl_d.h +0 -34
  501. data/ext/pg_query/include/commands/variable.h +0 -38
  502. data/ext/pg_query/include/common/ip.h +0 -31
  503. data/ext/pg_query/include/getaddrinfo.h +0 -162
  504. data/ext/pg_query/include/kwlist_d.h +0 -1095
  505. data/ext/pg_query/include/parser/gram.h +0 -1101
  506. data/ext/pg_query/include/pg_config_os.h +0 -8
  507. data/ext/pg_query/include/portability/instr_time.h +0 -256
  508. data/ext/pg_query/include/postmaster/auxprocess.h +0 -20
  509. data/ext/pg_query/include/postmaster/fork_process.h +0 -17
  510. data/ext/pg_query/include/postmaster/pgarch.h +0 -73
  511. data/ext/pg_query/include/replication/logicalworker.h +0 -19
  512. data/ext/pg_query/include/storage/relfilenode.h +0 -99
  513. data/ext/pg_query/include/utils/dynahash.h +0 -20
  514. data/ext/pg_query/include/utils/pg_lsn.h +0 -29
  515. data/ext/pg_query/include/utils/pidfile.h +0 -56
  516. data/ext/pg_query/include/utils/ps_status.h +0 -25
  517. data/ext/pg_query/include/utils/rls.h +0 -50
  518. data/ext/pg_query/include/utils/tzparser.h +0 -39
  519. data/ext/pg_query/src_backend_postmaster_postmaster.c +0 -2201
  520. data/ext/pg_query/src_backend_storage_lmgr_s_lock.c +0 -371
  521. data/ext/pg_query/src_backend_utils_hash_dynahash.c +0 -1116
  522. data/ext/pg_query/src_backend_utils_misc_guc.c +0 -1993
  523. data/ext/pg_query/src_common_pg_prng.c +0 -152
  524. data/ext/pg_query/src_common_string.c +0 -92
  525. data/ext/pg_query/src_port_pgsleep.c +0 -69
  526. data/ext/pg_query/src_port_strnlen.c +0 -39
  527. /data/ext/pg_query/include/{access → postgres/access}/rmgr.h +0 -0
  528. /data/ext/pg_query/include/{pg_config_ext.h → postgres/pg_config_ext.h} +0 -0
  529. /data/ext/pg_query/include/{plerrcodes.h → postgres/plerrcodes.h} +0 -0
  530. /data/ext/pg_query/include/{storage → postgres/storage}/lwlocknames.h +0 -0
  531. /data/ext/pg_query/include/{utils → postgres/utils}/errcodes.h +0 -0
@@ -1,247 +1,11 @@
1
1
  /*--------------------------------------------------------------------
2
2
  * Symbols referenced in this file:
3
3
  * - equal
4
- * - _equalAlias
5
- * - _equalRangeVar
6
- * - _equalTableFunc
7
- * - _equalIntoClause
8
- * - _equalVar
9
4
  * - _equalConst
10
- * - _equalParam
11
- * - _equalAggref
12
- * - _equalGroupingFunc
13
- * - _equalWindowFunc
14
- * - _equalSubscriptingRef
15
- * - _equalFuncExpr
16
- * - _equalNamedArgExpr
17
- * - _equalOpExpr
18
- * - _equalDistinctExpr
19
- * - _equalNullIfExpr
20
- * - _equalScalarArrayOpExpr
21
- * - _equalBoolExpr
22
- * - _equalSubLink
23
- * - _equalSubPlan
24
- * - _equalAlternativeSubPlan
25
- * - _equalFieldSelect
26
- * - _equalFieldStore
27
- * - _equalRelabelType
28
- * - _equalCoerceViaIO
29
- * - _equalArrayCoerceExpr
30
- * - _equalConvertRowtypeExpr
31
- * - _equalCollateExpr
32
- * - _equalCaseExpr
33
- * - _equalCaseWhen
34
- * - _equalCaseTestExpr
35
- * - _equalArrayExpr
36
- * - _equalRowExpr
37
- * - _equalRowCompareExpr
38
- * - _equalCoalesceExpr
39
- * - _equalMinMaxExpr
40
- * - _equalSQLValueFunction
41
- * - _equalXmlExpr
42
- * - _equalNullTest
43
- * - _equalBooleanTest
44
- * - _equalCoerceToDomain
45
- * - _equalCoerceToDomainValue
46
- * - _equalSetToDefault
47
- * - _equalCurrentOfExpr
48
- * - _equalNextValueExpr
49
- * - _equalInferenceElem
50
- * - _equalTargetEntry
51
- * - _equalRangeTblRef
52
- * - _equalFromExpr
53
- * - _equalOnConflictExpr
54
- * - _equalJoinExpr
55
- * - _equalPathKey
56
- * - _equalRestrictInfo
57
- * - _equalPlaceHolderVar
58
- * - _equalSpecialJoinInfo
59
- * - _equalAppendRelInfo
60
- * - _equalPlaceHolderInfo
61
- * - _equalList
62
- * - _equalInteger
63
- * - _equalFloat
64
- * - _equalBoolean
65
- * - _equalString
66
- * - _equalBitString
67
- * - _equalExtensibleNode
68
- * - _equalQuery
69
- * - _equalRawStmt
70
- * - _equalInsertStmt
71
- * - _equalDeleteStmt
72
- * - _equalUpdateStmt
73
- * - _equalMergeStmt
74
- * - _equalSelectStmt
75
- * - _equalSetOperationStmt
76
- * - _equalReturnStmt
77
- * - _equalPLAssignStmt
78
- * - _equalAlterTableStmt
79
- * - _equalAlterTableCmd
80
- * - _equalAlterCollationStmt
81
- * - _equalAlterDomainStmt
82
- * - _equalGrantStmt
83
- * - _equalGrantRoleStmt
84
- * - _equalAlterDefaultPrivilegesStmt
85
- * - _equalDeclareCursorStmt
86
- * - _equalClosePortalStmt
87
- * - _equalCallStmt
88
- * - _equalClusterStmt
89
- * - _equalCopyStmt
90
- * - _equalCreateStmt
91
- * - _equalTableLikeClause
92
- * - _equalDefineStmt
93
- * - _equalDropStmt
94
- * - _equalTruncateStmt
95
- * - _equalCommentStmt
96
- * - _equalSecLabelStmt
97
- * - _equalFetchStmt
98
- * - _equalIndexStmt
99
- * - _equalCreateStatsStmt
100
- * - _equalAlterStatsStmt
101
- * - _equalCreateFunctionStmt
102
- * - _equalFunctionParameter
103
- * - _equalAlterFunctionStmt
104
- * - _equalDoStmt
105
- * - _equalRenameStmt
106
- * - _equalAlterObjectDependsStmt
107
- * - _equalAlterObjectSchemaStmt
108
- * - _equalAlterOwnerStmt
109
- * - _equalAlterOperatorStmt
110
- * - _equalAlterTypeStmt
111
- * - _equalRuleStmt
112
- * - _equalNotifyStmt
113
- * - _equalListenStmt
114
- * - _equalUnlistenStmt
115
- * - _equalTransactionStmt
116
- * - _equalCompositeTypeStmt
117
- * - _equalCreateEnumStmt
118
- * - _equalCreateRangeStmt
119
- * - _equalAlterEnumStmt
120
- * - _equalViewStmt
121
- * - _equalLoadStmt
122
- * - _equalCreateDomainStmt
123
- * - _equalCreateOpClassStmt
124
- * - _equalCreateOpClassItem
125
- * - _equalCreateOpFamilyStmt
126
- * - _equalAlterOpFamilyStmt
127
- * - _equalCreatedbStmt
128
- * - _equalAlterDatabaseStmt
129
- * - _equalAlterDatabaseRefreshCollStmt
130
- * - _equalAlterDatabaseSetStmt
131
- * - _equalDropdbStmt
132
- * - _equalVacuumStmt
133
- * - _equalVacuumRelation
134
- * - _equalExplainStmt
135
- * - _equalCreateTableAsStmt
136
- * - _equalRefreshMatViewStmt
137
- * - _equalReplicaIdentityStmt
138
- * - _equalAlterSystemStmt
139
- * - _equalCreateSeqStmt
140
- * - _equalAlterSeqStmt
141
- * - _equalVariableSetStmt
142
- * - _equalVariableShowStmt
143
- * - _equalDiscardStmt
144
- * - _equalCreateTableSpaceStmt
145
- * - _equalDropTableSpaceStmt
146
- * - _equalAlterTableSpaceOptionsStmt
147
- * - _equalAlterTableMoveAllStmt
148
- * - _equalCreateExtensionStmt
149
- * - _equalAlterExtensionStmt
150
- * - _equalAlterExtensionContentsStmt
151
- * - _equalCreateFdwStmt
152
- * - _equalAlterFdwStmt
153
- * - _equalCreateForeignServerStmt
154
- * - _equalAlterForeignServerStmt
155
- * - _equalCreateUserMappingStmt
156
- * - _equalAlterUserMappingStmt
157
- * - _equalDropUserMappingStmt
158
- * - _equalCreateForeignTableStmt
159
- * - _equalImportForeignSchemaStmt
160
- * - _equalCreateTransformStmt
161
- * - _equalCreateAmStmt
162
- * - _equalCreateTrigStmt
163
- * - _equalCreateEventTrigStmt
164
- * - _equalAlterEventTrigStmt
165
- * - _equalCreatePLangStmt
166
- * - _equalCreateRoleStmt
167
- * - _equalAlterRoleStmt
168
- * - _equalAlterRoleSetStmt
169
- * - _equalDropRoleStmt
170
- * - _equalLockStmt
171
- * - _equalConstraintsSetStmt
172
- * - _equalReindexStmt
173
- * - _equalCreateSchemaStmt
174
- * - _equalCreateConversionStmt
175
- * - _equalCreateCastStmt
176
- * - _equalPrepareStmt
177
- * - _equalExecuteStmt
178
- * - _equalDeallocateStmt
179
- * - _equalDropOwnedStmt
180
- * - _equalReassignOwnedStmt
181
- * - _equalAlterTSDictionaryStmt
182
- * - _equalAlterTSConfigurationStmt
183
- * - _equalCreatePolicyStmt
184
- * - _equalAlterPolicyStmt
185
- * - _equalCreatePublicationStmt
186
- * - _equalAlterPublicationStmt
187
- * - _equalCreateSubscriptionStmt
188
- * - _equalAlterSubscriptionStmt
189
- * - _equalDropSubscriptionStmt
190
- * - _equalA_Expr
191
- * - _equalColumnRef
192
- * - _equalParamRef
193
5
  * - _equalA_Const
194
- * - _equalFuncCall
195
- * - _equalA_Star
196
- * - _equalA_Indices
197
- * - _equalA_Indirection
198
- * - _equalA_ArrayExpr
199
- * - _equalResTarget
200
- * - _equalMultiAssignRef
201
- * - _equalTypeCast
202
- * - _equalCollateClause
203
- * - _equalSortBy
204
- * - _equalWindowDef
205
- * - _equalRangeSubselect
206
- * - _equalRangeFunction
207
- * - _equalRangeTableSample
208
- * - _equalRangeTableFunc
209
- * - _equalRangeTableFuncCol
210
- * - _equalTypeName
211
- * - _equalIndexElem
212
- * - _equalStatsElem
213
- * - _equalColumnDef
214
- * - _equalConstraint
215
- * - _equalDefElem
216
- * - _equalLockingClause
217
- * - _equalRangeTblEntry
218
- * - _equalRangeTblFunction
219
- * - _equalTableSampleClause
220
- * - _equalWithCheckOption
221
- * - _equalSortGroupClause
222
- * - _equalGroupingSet
223
- * - _equalWindowClause
224
- * - _equalRowMarkClause
225
- * - _equalWithClause
226
- * - _equalInferClause
227
- * - _equalOnConflictClause
228
- * - _equalCTESearchClause
229
- * - _equalCTECycleClause
230
- * - _equalCommonTableExpr
231
- * - _equalMergeWhenClause
232
- * - _equalMergeAction
233
- * - _equalObjectWithArgs
234
- * - _equalAccessPriv
235
- * - _equalXmlSerialize
236
- * - _equalRoleSpec
237
- * - _equalTriggerTransition
238
- * - _equalPartitionElem
239
- * - _equalPartitionSpec
240
- * - _equalPartitionBoundSpec
241
- * - _equalPartitionRangeDatum
242
- * - _equalPartitionCmd
243
- * - _equalPublicationObject
244
- * - _equalPublicationTable
6
+ * - _equalBitmapset
7
+ * - _equalExtensibleNode
8
+ * - _equalList
245
9
  *--------------------------------------------------------------------
246
10
  */
247
11
 
@@ -250,22 +14,12 @@
250
14
  * equalfuncs.c
251
15
  * Equality functions to compare node trees.
252
16
  *
253
- * NOTE: we currently support comparing all node types found in parse
254
- * trees. We do not support comparing executor state trees; there
255
- * is no need for that, and no point in maintaining all the code that
256
- * would be needed. We also do not support comparing Path trees, mainly
257
- * because the circular linkages between RelOptInfo and Path nodes can't
258
- * be handled easily in a simple depth-first traversal.
259
- *
260
- * Currently, in fact, equal() doesn't know how to compare Plan trees
261
- * either. This might need to be fixed someday.
262
- *
263
17
  * NOTE: it is intentional that parse location fields (in nodes that have
264
18
  * one) are not compared. This is because we want, for example, a variable
265
19
  * "x" to be considered equal() to another reference to "x" in the query.
266
20
  *
267
21
  *
268
- * Portions Copyright (c) 1996-2022, PostgreSQL Global Development Group
22
+ * Portions Copyright (c) 1996-2023, PostgreSQL Global Development Group
269
23
  * Portions Copyright (c) 1994, Regents of the University of California
270
24
  *
271
25
  * IDENTIFICATION
@@ -277,8 +31,6 @@
277
31
  #include "postgres.h"
278
32
 
279
33
  #include "miscadmin.h"
280
- #include "nodes/extensible.h"
281
- #include "nodes/pathnodes.h"
282
34
  #include "utils/datum.h"
283
35
 
284
36
 
@@ -344,95 +96,13 @@
344
96
  ((void) 0)
345
97
 
346
98
 
347
- /*
348
- * Stuff from primnodes.h
349
- */
350
-
351
- static bool
352
- _equalAlias(const Alias *a, const Alias *b)
353
- {
354
- COMPARE_STRING_FIELD(aliasname);
355
- COMPARE_NODE_FIELD(colnames);
356
-
357
- return true;
358
- }
359
-
360
- static bool
361
- _equalRangeVar(const RangeVar *a, const RangeVar *b)
362
- {
363
- COMPARE_STRING_FIELD(catalogname);
364
- COMPARE_STRING_FIELD(schemaname);
365
- COMPARE_STRING_FIELD(relname);
366
- COMPARE_SCALAR_FIELD(inh);
367
- COMPARE_SCALAR_FIELD(relpersistence);
368
- COMPARE_NODE_FIELD(alias);
369
- COMPARE_LOCATION_FIELD(location);
370
-
371
- return true;
372
- }
373
-
374
- static bool
375
- _equalTableFunc(const TableFunc *a, const TableFunc *b)
376
- {
377
- COMPARE_NODE_FIELD(ns_uris);
378
- COMPARE_NODE_FIELD(ns_names);
379
- COMPARE_NODE_FIELD(docexpr);
380
- COMPARE_NODE_FIELD(rowexpr);
381
- COMPARE_NODE_FIELD(colnames);
382
- COMPARE_NODE_FIELD(coltypes);
383
- COMPARE_NODE_FIELD(coltypmods);
384
- COMPARE_NODE_FIELD(colcollations);
385
- COMPARE_NODE_FIELD(colexprs);
386
- COMPARE_NODE_FIELD(coldefexprs);
387
- COMPARE_BITMAPSET_FIELD(notnulls);
388
- COMPARE_SCALAR_FIELD(ordinalitycol);
389
- COMPARE_LOCATION_FIELD(location);
390
-
391
- return true;
392
- }
393
-
394
- static bool
395
- _equalIntoClause(const IntoClause *a, const IntoClause *b)
396
- {
397
- COMPARE_NODE_FIELD(rel);
398
- COMPARE_NODE_FIELD(colNames);
399
- COMPARE_STRING_FIELD(accessMethod);
400
- COMPARE_NODE_FIELD(options);
401
- COMPARE_SCALAR_FIELD(onCommit);
402
- COMPARE_STRING_FIELD(tableSpaceName);
403
- COMPARE_NODE_FIELD(viewQuery);
404
- COMPARE_SCALAR_FIELD(skipData);
99
+ #include "equalfuncs.funcs.c"
405
100
 
406
- return true;
407
- }
408
101
 
409
102
  /*
410
- * We don't need an _equalExpr because Expr is an abstract supertype which
411
- * should never actually get instantiated. Also, since it has no common
412
- * fields except NodeTag, there's no need for a helper routine to factor
413
- * out comparing the common fields...
103
+ * Support functions for nodes with custom_copy_equal attribute
414
104
  */
415
105
 
416
- static bool
417
- _equalVar(const Var *a, const Var *b)
418
- {
419
- COMPARE_SCALAR_FIELD(varno);
420
- COMPARE_SCALAR_FIELD(varattno);
421
- COMPARE_SCALAR_FIELD(vartype);
422
- COMPARE_SCALAR_FIELD(vartypmod);
423
- COMPARE_SCALAR_FIELD(varcollid);
424
- COMPARE_SCALAR_FIELD(varlevelsup);
425
-
426
- /*
427
- * varnosyn/varattnosyn are intentionally ignored here, because Vars with
428
- * different syntactic identifiers are semantically the same as long as
429
- * their varno/varattno match.
430
- */
431
- COMPARE_LOCATION_FIELD(location);
432
-
433
- return true;
434
- }
435
-
436
106
  static bool
437
107
  _equalConst(const Const *a, const Const *b)
438
108
  {
@@ -455,3788 +125,145 @@ _equalConst(const Const *a, const Const *b)
455
125
  }
456
126
 
457
127
  static bool
458
- _equalParam(const Param *a, const Param *b)
459
- {
460
- COMPARE_SCALAR_FIELD(paramkind);
461
- COMPARE_SCALAR_FIELD(paramid);
462
- COMPARE_SCALAR_FIELD(paramtype);
463
- COMPARE_SCALAR_FIELD(paramtypmod);
464
- COMPARE_SCALAR_FIELD(paramcollid);
465
- COMPARE_LOCATION_FIELD(location);
466
-
467
- return true;
468
- }
469
-
470
- static bool
471
- _equalAggref(const Aggref *a, const Aggref *b)
472
- {
473
- COMPARE_SCALAR_FIELD(aggfnoid);
474
- COMPARE_SCALAR_FIELD(aggtype);
475
- COMPARE_SCALAR_FIELD(aggcollid);
476
- COMPARE_SCALAR_FIELD(inputcollid);
477
- /* ignore aggtranstype since it might not be set yet */
478
- COMPARE_NODE_FIELD(aggargtypes);
479
- COMPARE_NODE_FIELD(aggdirectargs);
480
- COMPARE_NODE_FIELD(args);
481
- COMPARE_NODE_FIELD(aggorder);
482
- COMPARE_NODE_FIELD(aggdistinct);
483
- COMPARE_NODE_FIELD(aggfilter);
484
- COMPARE_SCALAR_FIELD(aggstar);
485
- COMPARE_SCALAR_FIELD(aggvariadic);
486
- COMPARE_SCALAR_FIELD(aggkind);
487
- COMPARE_SCALAR_FIELD(agglevelsup);
488
- COMPARE_SCALAR_FIELD(aggsplit);
489
- COMPARE_SCALAR_FIELD(aggno);
490
- COMPARE_SCALAR_FIELD(aggtransno);
491
- COMPARE_LOCATION_FIELD(location);
492
-
493
- return true;
494
- }
495
-
496
- static bool
497
- _equalGroupingFunc(const GroupingFunc *a, const GroupingFunc *b)
128
+ _equalExtensibleNode(const ExtensibleNode *a, const ExtensibleNode *b)
498
129
  {
499
- COMPARE_NODE_FIELD(args);
500
-
501
- /*
502
- * We must not compare the refs or cols field
503
- */
504
-
505
- COMPARE_SCALAR_FIELD(agglevelsup);
506
- COMPARE_LOCATION_FIELD(location);
507
-
508
- return true;
509
- }
130
+ const ExtensibleNodeMethods *methods;
510
131
 
511
- static bool
512
- _equalWindowFunc(const WindowFunc *a, const WindowFunc *b)
513
- {
514
- COMPARE_SCALAR_FIELD(winfnoid);
515
- COMPARE_SCALAR_FIELD(wintype);
516
- COMPARE_SCALAR_FIELD(wincollid);
517
- COMPARE_SCALAR_FIELD(inputcollid);
518
- COMPARE_NODE_FIELD(args);
519
- COMPARE_NODE_FIELD(aggfilter);
520
- COMPARE_SCALAR_FIELD(winref);
521
- COMPARE_SCALAR_FIELD(winstar);
522
- COMPARE_SCALAR_FIELD(winagg);
523
- COMPARE_LOCATION_FIELD(location);
132
+ COMPARE_STRING_FIELD(extnodename);
524
133
 
525
- return true;
526
- }
134
+ /* At this point, we know extnodename is the same for both nodes. */
135
+ methods = GetExtensibleNodeMethods(a->extnodename, false);
527
136
 
528
- static bool
529
- _equalSubscriptingRef(const SubscriptingRef *a, const SubscriptingRef *b)
530
- {
531
- COMPARE_SCALAR_FIELD(refcontainertype);
532
- COMPARE_SCALAR_FIELD(refelemtype);
533
- COMPARE_SCALAR_FIELD(refrestype);
534
- COMPARE_SCALAR_FIELD(reftypmod);
535
- COMPARE_SCALAR_FIELD(refcollid);
536
- COMPARE_NODE_FIELD(refupperindexpr);
537
- COMPARE_NODE_FIELD(reflowerindexpr);
538
- COMPARE_NODE_FIELD(refexpr);
539
- COMPARE_NODE_FIELD(refassgnexpr);
137
+ /* compare the private fields */
138
+ if (!methods->nodeEqual(a, b))
139
+ return false;
540
140
 
541
141
  return true;
542
142
  }
543
143
 
544
144
  static bool
545
- _equalFuncExpr(const FuncExpr *a, const FuncExpr *b)
145
+ _equalA_Const(const A_Const *a, const A_Const *b)
546
146
  {
547
- COMPARE_SCALAR_FIELD(funcid);
548
- COMPARE_SCALAR_FIELD(funcresulttype);
549
- COMPARE_SCALAR_FIELD(funcretset);
550
- COMPARE_SCALAR_FIELD(funcvariadic);
551
- COMPARE_COERCIONFORM_FIELD(funcformat);
552
- COMPARE_SCALAR_FIELD(funccollid);
553
- COMPARE_SCALAR_FIELD(inputcollid);
554
- COMPARE_NODE_FIELD(args);
147
+ COMPARE_SCALAR_FIELD(isnull);
148
+ /* Hack for in-line val field. Also val is not valid if isnull is true */
149
+ if (!a->isnull &&
150
+ !equal(&a->val, &b->val))
151
+ return false;
555
152
  COMPARE_LOCATION_FIELD(location);
556
153
 
557
154
  return true;
558
155
  }
559
156
 
560
157
  static bool
561
- _equalNamedArgExpr(const NamedArgExpr *a, const NamedArgExpr *b)
158
+ _equalBitmapset(const Bitmapset *a, const Bitmapset *b)
562
159
  {
563
- COMPARE_NODE_FIELD(arg);
564
- COMPARE_STRING_FIELD(name);
565
- COMPARE_SCALAR_FIELD(argnumber);
566
- COMPARE_LOCATION_FIELD(location);
567
-
568
- return true;
160
+ return bms_equal(a, b);
569
161
  }
570
162
 
163
+ /*
164
+ * Lists are handled specially
165
+ */
571
166
  static bool
572
- _equalOpExpr(const OpExpr *a, const OpExpr *b)
167
+ _equalList(const List *a, const List *b)
573
168
  {
574
- COMPARE_SCALAR_FIELD(opno);
169
+ const ListCell *item_a;
170
+ const ListCell *item_b;
575
171
 
576
172
  /*
577
- * Special-case opfuncid: it is allowable for it to differ if one node
578
- * contains zero and the other doesn't. This just means that the one node
579
- * isn't as far along in the parse/plan pipeline and hasn't had the
580
- * opfuncid cache filled yet.
173
+ * Try to reject by simple scalar checks before grovelling through all the
174
+ * list elements...
581
175
  */
582
- if (a->opfuncid != b->opfuncid &&
583
- a->opfuncid != 0 &&
584
- b->opfuncid != 0)
585
- return false;
586
-
587
- COMPARE_SCALAR_FIELD(opresulttype);
588
- COMPARE_SCALAR_FIELD(opretset);
589
- COMPARE_SCALAR_FIELD(opcollid);
590
- COMPARE_SCALAR_FIELD(inputcollid);
591
- COMPARE_NODE_FIELD(args);
592
- COMPARE_LOCATION_FIELD(location);
593
-
594
- return true;
595
- }
596
-
597
- static bool
598
- _equalDistinctExpr(const DistinctExpr *a, const DistinctExpr *b)
599
- {
600
- COMPARE_SCALAR_FIELD(opno);
176
+ COMPARE_SCALAR_FIELD(type);
177
+ COMPARE_SCALAR_FIELD(length);
601
178
 
602
179
  /*
603
- * Special-case opfuncid: it is allowable for it to differ if one node
604
- * contains zero and the other doesn't. This just means that the one node
605
- * isn't as far along in the parse/plan pipeline and hasn't had the
606
- * opfuncid cache filled yet.
180
+ * We place the switch outside the loop for the sake of efficiency; this
181
+ * may not be worth doing...
607
182
  */
608
- if (a->opfuncid != b->opfuncid &&
609
- a->opfuncid != 0 &&
610
- b->opfuncid != 0)
611
- return false;
612
-
613
- COMPARE_SCALAR_FIELD(opresulttype);
614
- COMPARE_SCALAR_FIELD(opretset);
615
- COMPARE_SCALAR_FIELD(opcollid);
616
- COMPARE_SCALAR_FIELD(inputcollid);
617
- COMPARE_NODE_FIELD(args);
618
- COMPARE_LOCATION_FIELD(location);
619
-
620
- return true;
621
- }
622
-
623
- static bool
624
- _equalNullIfExpr(const NullIfExpr *a, const NullIfExpr *b)
625
- {
626
- COMPARE_SCALAR_FIELD(opno);
183
+ switch (a->type)
184
+ {
185
+ case T_List:
186
+ forboth(item_a, a, item_b, b)
187
+ {
188
+ if (!equal(lfirst(item_a), lfirst(item_b)))
189
+ return false;
190
+ }
191
+ break;
192
+ case T_IntList:
193
+ forboth(item_a, a, item_b, b)
194
+ {
195
+ if (lfirst_int(item_a) != lfirst_int(item_b))
196
+ return false;
197
+ }
198
+ break;
199
+ case T_OidList:
200
+ forboth(item_a, a, item_b, b)
201
+ {
202
+ if (lfirst_oid(item_a) != lfirst_oid(item_b))
203
+ return false;
204
+ }
205
+ break;
206
+ case T_XidList:
207
+ forboth(item_a, a, item_b, b)
208
+ {
209
+ if (lfirst_xid(item_a) != lfirst_xid(item_b))
210
+ return false;
211
+ }
212
+ break;
213
+ default:
214
+ elog(ERROR, "unrecognized list node type: %d",
215
+ (int) a->type);
216
+ return false; /* keep compiler quiet */
217
+ }
627
218
 
628
219
  /*
629
- * Special-case opfuncid: it is allowable for it to differ if one node
630
- * contains zero and the other doesn't. This just means that the one node
631
- * isn't as far along in the parse/plan pipeline and hasn't had the
632
- * opfuncid cache filled yet.
220
+ * If we got here, we should have run out of elements of both lists
633
221
  */
634
- if (a->opfuncid != b->opfuncid &&
635
- a->opfuncid != 0 &&
636
- b->opfuncid != 0)
637
- return false;
638
-
639
- COMPARE_SCALAR_FIELD(opresulttype);
640
- COMPARE_SCALAR_FIELD(opretset);
641
- COMPARE_SCALAR_FIELD(opcollid);
642
- COMPARE_SCALAR_FIELD(inputcollid);
643
- COMPARE_NODE_FIELD(args);
644
- COMPARE_LOCATION_FIELD(location);
222
+ Assert(item_a == NULL);
223
+ Assert(item_b == NULL);
645
224
 
646
225
  return true;
647
226
  }
648
227
 
649
- static bool
650
- _equalScalarArrayOpExpr(const ScalarArrayOpExpr *a, const ScalarArrayOpExpr *b)
228
+
229
+ /*
230
+ * equal
231
+ * returns whether two nodes are equal
232
+ */
233
+ bool
234
+ equal(const void *a, const void *b)
651
235
  {
652
- COMPARE_SCALAR_FIELD(opno);
236
+ bool retval;
237
+
238
+ if (a == b)
239
+ return true;
653
240
 
654
241
  /*
655
- * Special-case opfuncid: it is allowable for it to differ if one node
656
- * contains zero and the other doesn't. This just means that the one node
657
- * isn't as far along in the parse/plan pipeline and hasn't had the
658
- * opfuncid cache filled yet.
242
+ * note that a!=b, so only one of them can be NULL
659
243
  */
660
- if (a->opfuncid != b->opfuncid &&
661
- a->opfuncid != 0 &&
662
- b->opfuncid != 0)
663
- return false;
664
-
665
- /* As above, hashfuncid may differ too */
666
- if (a->hashfuncid != b->hashfuncid &&
667
- a->hashfuncid != 0 &&
668
- b->hashfuncid != 0)
244
+ if (a == NULL || b == NULL)
669
245
  return false;
670
246
 
671
- /* Likewise for the negfuncid */
672
- if (a->negfuncid != b->negfuncid &&
673
- a->negfuncid != 0 &&
674
- b->negfuncid != 0)
247
+ /*
248
+ * are they the same type of nodes?
249
+ */
250
+ if (nodeTag(a) != nodeTag(b))
675
251
  return false;
676
252
 
677
- COMPARE_SCALAR_FIELD(useOr);
678
- COMPARE_SCALAR_FIELD(inputcollid);
679
- COMPARE_NODE_FIELD(args);
680
- COMPARE_LOCATION_FIELD(location);
681
-
682
- return true;
683
- }
684
-
685
- static bool
686
- _equalBoolExpr(const BoolExpr *a, const BoolExpr *b)
687
- {
688
- COMPARE_SCALAR_FIELD(boolop);
689
- COMPARE_NODE_FIELD(args);
690
- COMPARE_LOCATION_FIELD(location);
691
-
692
- return true;
693
- }
694
-
695
- static bool
696
- _equalSubLink(const SubLink *a, const SubLink *b)
697
- {
698
- COMPARE_SCALAR_FIELD(subLinkType);
699
- COMPARE_SCALAR_FIELD(subLinkId);
700
- COMPARE_NODE_FIELD(testexpr);
701
- COMPARE_NODE_FIELD(operName);
702
- COMPARE_NODE_FIELD(subselect);
703
- COMPARE_LOCATION_FIELD(location);
704
-
705
- return true;
706
- }
707
-
708
- static bool
709
- _equalSubPlan(const SubPlan *a, const SubPlan *b)
710
- {
711
- COMPARE_SCALAR_FIELD(subLinkType);
712
- COMPARE_NODE_FIELD(testexpr);
713
- COMPARE_NODE_FIELD(paramIds);
714
- COMPARE_SCALAR_FIELD(plan_id);
715
- COMPARE_STRING_FIELD(plan_name);
716
- COMPARE_SCALAR_FIELD(firstColType);
717
- COMPARE_SCALAR_FIELD(firstColTypmod);
718
- COMPARE_SCALAR_FIELD(firstColCollation);
719
- COMPARE_SCALAR_FIELD(useHashTable);
720
- COMPARE_SCALAR_FIELD(unknownEqFalse);
721
- COMPARE_SCALAR_FIELD(parallel_safe);
722
- COMPARE_NODE_FIELD(setParam);
723
- COMPARE_NODE_FIELD(parParam);
724
- COMPARE_NODE_FIELD(args);
725
- COMPARE_SCALAR_FIELD(startup_cost);
726
- COMPARE_SCALAR_FIELD(per_call_cost);
727
-
728
- return true;
729
- }
730
-
731
- static bool
732
- _equalAlternativeSubPlan(const AlternativeSubPlan *a, const AlternativeSubPlan *b)
733
- {
734
- COMPARE_NODE_FIELD(subplans);
735
-
736
- return true;
737
- }
738
-
739
- static bool
740
- _equalFieldSelect(const FieldSelect *a, const FieldSelect *b)
741
- {
742
- COMPARE_NODE_FIELD(arg);
743
- COMPARE_SCALAR_FIELD(fieldnum);
744
- COMPARE_SCALAR_FIELD(resulttype);
745
- COMPARE_SCALAR_FIELD(resulttypmod);
746
- COMPARE_SCALAR_FIELD(resultcollid);
747
-
748
- return true;
749
- }
750
-
751
- static bool
752
- _equalFieldStore(const FieldStore *a, const FieldStore *b)
753
- {
754
- COMPARE_NODE_FIELD(arg);
755
- COMPARE_NODE_FIELD(newvals);
756
- COMPARE_NODE_FIELD(fieldnums);
757
- COMPARE_SCALAR_FIELD(resulttype);
758
-
759
- return true;
760
- }
761
-
762
- static bool
763
- _equalRelabelType(const RelabelType *a, const RelabelType *b)
764
- {
765
- COMPARE_NODE_FIELD(arg);
766
- COMPARE_SCALAR_FIELD(resulttype);
767
- COMPARE_SCALAR_FIELD(resulttypmod);
768
- COMPARE_SCALAR_FIELD(resultcollid);
769
- COMPARE_COERCIONFORM_FIELD(relabelformat);
770
- COMPARE_LOCATION_FIELD(location);
771
-
772
- return true;
773
- }
774
-
775
- static bool
776
- _equalCoerceViaIO(const CoerceViaIO *a, const CoerceViaIO *b)
777
- {
778
- COMPARE_NODE_FIELD(arg);
779
- COMPARE_SCALAR_FIELD(resulttype);
780
- COMPARE_SCALAR_FIELD(resultcollid);
781
- COMPARE_COERCIONFORM_FIELD(coerceformat);
782
- COMPARE_LOCATION_FIELD(location);
783
-
784
- return true;
785
- }
786
-
787
- static bool
788
- _equalArrayCoerceExpr(const ArrayCoerceExpr *a, const ArrayCoerceExpr *b)
789
- {
790
- COMPARE_NODE_FIELD(arg);
791
- COMPARE_NODE_FIELD(elemexpr);
792
- COMPARE_SCALAR_FIELD(resulttype);
793
- COMPARE_SCALAR_FIELD(resulttypmod);
794
- COMPARE_SCALAR_FIELD(resultcollid);
795
- COMPARE_COERCIONFORM_FIELD(coerceformat);
796
- COMPARE_LOCATION_FIELD(location);
797
-
798
- return true;
799
- }
800
-
801
- static bool
802
- _equalConvertRowtypeExpr(const ConvertRowtypeExpr *a, const ConvertRowtypeExpr *b)
803
- {
804
- COMPARE_NODE_FIELD(arg);
805
- COMPARE_SCALAR_FIELD(resulttype);
806
- COMPARE_COERCIONFORM_FIELD(convertformat);
807
- COMPARE_LOCATION_FIELD(location);
808
-
809
- return true;
810
- }
811
-
812
- static bool
813
- _equalCollateExpr(const CollateExpr *a, const CollateExpr *b)
814
- {
815
- COMPARE_NODE_FIELD(arg);
816
- COMPARE_SCALAR_FIELD(collOid);
817
- COMPARE_LOCATION_FIELD(location);
253
+ /* Guard against stack overflow due to overly complex expressions */
254
+ check_stack_depth();
818
255
 
819
- return true;
820
- }
821
-
822
- static bool
823
- _equalCaseExpr(const CaseExpr *a, const CaseExpr *b)
824
- {
825
- COMPARE_SCALAR_FIELD(casetype);
826
- COMPARE_SCALAR_FIELD(casecollid);
827
- COMPARE_NODE_FIELD(arg);
828
- COMPARE_NODE_FIELD(args);
829
- COMPARE_NODE_FIELD(defresult);
830
- COMPARE_LOCATION_FIELD(location);
831
-
832
- return true;
833
- }
834
-
835
- static bool
836
- _equalCaseWhen(const CaseWhen *a, const CaseWhen *b)
837
- {
838
- COMPARE_NODE_FIELD(expr);
839
- COMPARE_NODE_FIELD(result);
840
- COMPARE_LOCATION_FIELD(location);
841
-
842
- return true;
843
- }
844
-
845
- static bool
846
- _equalCaseTestExpr(const CaseTestExpr *a, const CaseTestExpr *b)
847
- {
848
- COMPARE_SCALAR_FIELD(typeId);
849
- COMPARE_SCALAR_FIELD(typeMod);
850
- COMPARE_SCALAR_FIELD(collation);
851
-
852
- return true;
853
- }
854
-
855
- static bool
856
- _equalArrayExpr(const ArrayExpr *a, const ArrayExpr *b)
857
- {
858
- COMPARE_SCALAR_FIELD(array_typeid);
859
- COMPARE_SCALAR_FIELD(array_collid);
860
- COMPARE_SCALAR_FIELD(element_typeid);
861
- COMPARE_NODE_FIELD(elements);
862
- COMPARE_SCALAR_FIELD(multidims);
863
- COMPARE_LOCATION_FIELD(location);
864
-
865
- return true;
866
- }
867
-
868
- static bool
869
- _equalRowExpr(const RowExpr *a, const RowExpr *b)
870
- {
871
- COMPARE_NODE_FIELD(args);
872
- COMPARE_SCALAR_FIELD(row_typeid);
873
- COMPARE_COERCIONFORM_FIELD(row_format);
874
- COMPARE_NODE_FIELD(colnames);
875
- COMPARE_LOCATION_FIELD(location);
876
-
877
- return true;
878
- }
879
-
880
- static bool
881
- _equalRowCompareExpr(const RowCompareExpr *a, const RowCompareExpr *b)
882
- {
883
- COMPARE_SCALAR_FIELD(rctype);
884
- COMPARE_NODE_FIELD(opnos);
885
- COMPARE_NODE_FIELD(opfamilies);
886
- COMPARE_NODE_FIELD(inputcollids);
887
- COMPARE_NODE_FIELD(largs);
888
- COMPARE_NODE_FIELD(rargs);
889
-
890
- return true;
891
- }
892
-
893
- static bool
894
- _equalCoalesceExpr(const CoalesceExpr *a, const CoalesceExpr *b)
895
- {
896
- COMPARE_SCALAR_FIELD(coalescetype);
897
- COMPARE_SCALAR_FIELD(coalescecollid);
898
- COMPARE_NODE_FIELD(args);
899
- COMPARE_LOCATION_FIELD(location);
900
-
901
- return true;
902
- }
903
-
904
- static bool
905
- _equalMinMaxExpr(const MinMaxExpr *a, const MinMaxExpr *b)
906
- {
907
- COMPARE_SCALAR_FIELD(minmaxtype);
908
- COMPARE_SCALAR_FIELD(minmaxcollid);
909
- COMPARE_SCALAR_FIELD(inputcollid);
910
- COMPARE_SCALAR_FIELD(op);
911
- COMPARE_NODE_FIELD(args);
912
- COMPARE_LOCATION_FIELD(location);
913
-
914
- return true;
915
- }
916
-
917
- static bool
918
- _equalSQLValueFunction(const SQLValueFunction *a, const SQLValueFunction *b)
919
- {
920
- COMPARE_SCALAR_FIELD(op);
921
- COMPARE_SCALAR_FIELD(type);
922
- COMPARE_SCALAR_FIELD(typmod);
923
- COMPARE_LOCATION_FIELD(location);
924
-
925
- return true;
926
- }
927
-
928
- static bool
929
- _equalXmlExpr(const XmlExpr *a, const XmlExpr *b)
930
- {
931
- COMPARE_SCALAR_FIELD(op);
932
- COMPARE_STRING_FIELD(name);
933
- COMPARE_NODE_FIELD(named_args);
934
- COMPARE_NODE_FIELD(arg_names);
935
- COMPARE_NODE_FIELD(args);
936
- COMPARE_SCALAR_FIELD(xmloption);
937
- COMPARE_SCALAR_FIELD(type);
938
- COMPARE_SCALAR_FIELD(typmod);
939
- COMPARE_LOCATION_FIELD(location);
940
-
941
- return true;
942
- }
943
-
944
- static bool
945
- _equalNullTest(const NullTest *a, const NullTest *b)
946
- {
947
- COMPARE_NODE_FIELD(arg);
948
- COMPARE_SCALAR_FIELD(nulltesttype);
949
- COMPARE_SCALAR_FIELD(argisrow);
950
- COMPARE_LOCATION_FIELD(location);
951
-
952
- return true;
953
- }
954
-
955
- static bool
956
- _equalBooleanTest(const BooleanTest *a, const BooleanTest *b)
957
- {
958
- COMPARE_NODE_FIELD(arg);
959
- COMPARE_SCALAR_FIELD(booltesttype);
960
- COMPARE_LOCATION_FIELD(location);
961
-
962
- return true;
963
- }
964
-
965
- static bool
966
- _equalCoerceToDomain(const CoerceToDomain *a, const CoerceToDomain *b)
967
- {
968
- COMPARE_NODE_FIELD(arg);
969
- COMPARE_SCALAR_FIELD(resulttype);
970
- COMPARE_SCALAR_FIELD(resulttypmod);
971
- COMPARE_SCALAR_FIELD(resultcollid);
972
- COMPARE_COERCIONFORM_FIELD(coercionformat);
973
- COMPARE_LOCATION_FIELD(location);
974
-
975
- return true;
976
- }
977
-
978
- static bool
979
- _equalCoerceToDomainValue(const CoerceToDomainValue *a, const CoerceToDomainValue *b)
980
- {
981
- COMPARE_SCALAR_FIELD(typeId);
982
- COMPARE_SCALAR_FIELD(typeMod);
983
- COMPARE_SCALAR_FIELD(collation);
984
- COMPARE_LOCATION_FIELD(location);
985
-
986
- return true;
987
- }
988
-
989
- static bool
990
- _equalSetToDefault(const SetToDefault *a, const SetToDefault *b)
991
- {
992
- COMPARE_SCALAR_FIELD(typeId);
993
- COMPARE_SCALAR_FIELD(typeMod);
994
- COMPARE_SCALAR_FIELD(collation);
995
- COMPARE_LOCATION_FIELD(location);
996
-
997
- return true;
998
- }
999
-
1000
- static bool
1001
- _equalCurrentOfExpr(const CurrentOfExpr *a, const CurrentOfExpr *b)
1002
- {
1003
- COMPARE_SCALAR_FIELD(cvarno);
1004
- COMPARE_STRING_FIELD(cursor_name);
1005
- COMPARE_SCALAR_FIELD(cursor_param);
1006
-
1007
- return true;
1008
- }
1009
-
1010
- static bool
1011
- _equalNextValueExpr(const NextValueExpr *a, const NextValueExpr *b)
1012
- {
1013
- COMPARE_SCALAR_FIELD(seqid);
1014
- COMPARE_SCALAR_FIELD(typeId);
1015
-
1016
- return true;
1017
- }
1018
-
1019
- static bool
1020
- _equalInferenceElem(const InferenceElem *a, const InferenceElem *b)
1021
- {
1022
- COMPARE_NODE_FIELD(expr);
1023
- COMPARE_SCALAR_FIELD(infercollid);
1024
- COMPARE_SCALAR_FIELD(inferopclass);
1025
-
1026
- return true;
1027
- }
1028
-
1029
- static bool
1030
- _equalTargetEntry(const TargetEntry *a, const TargetEntry *b)
1031
- {
1032
- COMPARE_NODE_FIELD(expr);
1033
- COMPARE_SCALAR_FIELD(resno);
1034
- COMPARE_STRING_FIELD(resname);
1035
- COMPARE_SCALAR_FIELD(ressortgroupref);
1036
- COMPARE_SCALAR_FIELD(resorigtbl);
1037
- COMPARE_SCALAR_FIELD(resorigcol);
1038
- COMPARE_SCALAR_FIELD(resjunk);
1039
-
1040
- return true;
1041
- }
1042
-
1043
- static bool
1044
- _equalRangeTblRef(const RangeTblRef *a, const RangeTblRef *b)
1045
- {
1046
- COMPARE_SCALAR_FIELD(rtindex);
1047
-
1048
- return true;
1049
- }
1050
-
1051
- static bool
1052
- _equalJoinExpr(const JoinExpr *a, const JoinExpr *b)
1053
- {
1054
- COMPARE_SCALAR_FIELD(jointype);
1055
- COMPARE_SCALAR_FIELD(isNatural);
1056
- COMPARE_NODE_FIELD(larg);
1057
- COMPARE_NODE_FIELD(rarg);
1058
- COMPARE_NODE_FIELD(usingClause);
1059
- COMPARE_NODE_FIELD(join_using_alias);
1060
- COMPARE_NODE_FIELD(quals);
1061
- COMPARE_NODE_FIELD(alias);
1062
- COMPARE_SCALAR_FIELD(rtindex);
1063
-
1064
- return true;
1065
- }
1066
-
1067
- static bool
1068
- _equalFromExpr(const FromExpr *a, const FromExpr *b)
1069
- {
1070
- COMPARE_NODE_FIELD(fromlist);
1071
- COMPARE_NODE_FIELD(quals);
1072
-
1073
- return true;
1074
- }
1075
-
1076
- static bool
1077
- _equalOnConflictExpr(const OnConflictExpr *a, const OnConflictExpr *b)
1078
- {
1079
- COMPARE_SCALAR_FIELD(action);
1080
- COMPARE_NODE_FIELD(arbiterElems);
1081
- COMPARE_NODE_FIELD(arbiterWhere);
1082
- COMPARE_SCALAR_FIELD(constraint);
1083
- COMPARE_NODE_FIELD(onConflictSet);
1084
- COMPARE_NODE_FIELD(onConflictWhere);
1085
- COMPARE_SCALAR_FIELD(exclRelIndex);
1086
- COMPARE_NODE_FIELD(exclRelTlist);
1087
-
1088
- return true;
1089
- }
1090
-
1091
- /*
1092
- * Stuff from pathnodes.h
1093
- */
1094
-
1095
- static bool
1096
- _equalPathKey(const PathKey *a, const PathKey *b)
1097
- {
1098
- /* We assume pointer equality is sufficient to compare the eclasses */
1099
- COMPARE_SCALAR_FIELD(pk_eclass);
1100
- COMPARE_SCALAR_FIELD(pk_opfamily);
1101
- COMPARE_SCALAR_FIELD(pk_strategy);
1102
- COMPARE_SCALAR_FIELD(pk_nulls_first);
1103
-
1104
- return true;
1105
- }
1106
-
1107
- static bool
1108
- _equalRestrictInfo(const RestrictInfo *a, const RestrictInfo *b)
1109
- {
1110
- COMPARE_NODE_FIELD(clause);
1111
- COMPARE_SCALAR_FIELD(is_pushed_down);
1112
- COMPARE_SCALAR_FIELD(outerjoin_delayed);
1113
- COMPARE_SCALAR_FIELD(security_level);
1114
- COMPARE_BITMAPSET_FIELD(required_relids);
1115
- COMPARE_BITMAPSET_FIELD(outer_relids);
1116
- COMPARE_BITMAPSET_FIELD(nullable_relids);
1117
-
1118
- /*
1119
- * We ignore all the remaining fields, since they may not be set yet, and
1120
- * should be derivable from the clause anyway.
1121
- */
1122
-
1123
- return true;
1124
- }
1125
-
1126
- static bool
1127
- _equalPlaceHolderVar(const PlaceHolderVar *a, const PlaceHolderVar *b)
1128
- {
1129
- /*
1130
- * We intentionally do not compare phexpr. Two PlaceHolderVars with the
1131
- * same ID and levelsup should be considered equal even if the contained
1132
- * expressions have managed to mutate to different states. This will
1133
- * happen during final plan construction when there are nested PHVs, since
1134
- * the inner PHV will get replaced by a Param in some copies of the outer
1135
- * PHV. Another way in which it can happen is that initplan sublinks
1136
- * could get replaced by differently-numbered Params when sublink folding
1137
- * is done. (The end result of such a situation would be some
1138
- * unreferenced initplans, which is annoying but not really a problem.) On
1139
- * the same reasoning, there is no need to examine phrels.
1140
- *
1141
- * COMPARE_NODE_FIELD(phexpr);
1142
- *
1143
- * COMPARE_BITMAPSET_FIELD(phrels);
1144
- */
1145
- COMPARE_SCALAR_FIELD(phid);
1146
- COMPARE_SCALAR_FIELD(phlevelsup);
1147
-
1148
- return true;
1149
- }
1150
-
1151
- static bool
1152
- _equalSpecialJoinInfo(const SpecialJoinInfo *a, const SpecialJoinInfo *b)
1153
- {
1154
- COMPARE_BITMAPSET_FIELD(min_lefthand);
1155
- COMPARE_BITMAPSET_FIELD(min_righthand);
1156
- COMPARE_BITMAPSET_FIELD(syn_lefthand);
1157
- COMPARE_BITMAPSET_FIELD(syn_righthand);
1158
- COMPARE_SCALAR_FIELD(jointype);
1159
- COMPARE_SCALAR_FIELD(lhs_strict);
1160
- COMPARE_SCALAR_FIELD(delay_upper_joins);
1161
- COMPARE_SCALAR_FIELD(semi_can_btree);
1162
- COMPARE_SCALAR_FIELD(semi_can_hash);
1163
- COMPARE_NODE_FIELD(semi_operators);
1164
- COMPARE_NODE_FIELD(semi_rhs_exprs);
1165
-
1166
- return true;
1167
- }
1168
-
1169
- static bool
1170
- _equalAppendRelInfo(const AppendRelInfo *a, const AppendRelInfo *b)
1171
- {
1172
- COMPARE_SCALAR_FIELD(parent_relid);
1173
- COMPARE_SCALAR_FIELD(child_relid);
1174
- COMPARE_SCALAR_FIELD(parent_reltype);
1175
- COMPARE_SCALAR_FIELD(child_reltype);
1176
- COMPARE_NODE_FIELD(translated_vars);
1177
- COMPARE_SCALAR_FIELD(num_child_cols);
1178
- COMPARE_POINTER_FIELD(parent_colnos, a->num_child_cols * sizeof(AttrNumber));
1179
- COMPARE_SCALAR_FIELD(parent_reloid);
1180
-
1181
- return true;
1182
- }
1183
-
1184
- static bool
1185
- _equalPlaceHolderInfo(const PlaceHolderInfo *a, const PlaceHolderInfo *b)
1186
- {
1187
- COMPARE_SCALAR_FIELD(phid);
1188
- COMPARE_NODE_FIELD(ph_var); /* should be redundant */
1189
- COMPARE_BITMAPSET_FIELD(ph_eval_at);
1190
- COMPARE_BITMAPSET_FIELD(ph_lateral);
1191
- COMPARE_BITMAPSET_FIELD(ph_needed);
1192
- COMPARE_SCALAR_FIELD(ph_width);
1193
-
1194
- return true;
1195
- }
1196
-
1197
- /*
1198
- * Stuff from extensible.h
1199
- */
1200
- static bool
1201
- _equalExtensibleNode(const ExtensibleNode *a, const ExtensibleNode *b)
1202
- {
1203
- const ExtensibleNodeMethods *methods;
1204
-
1205
- COMPARE_STRING_FIELD(extnodename);
1206
-
1207
- /* At this point, we know extnodename is the same for both nodes. */
1208
- methods = GetExtensibleNodeMethods(a->extnodename, false);
1209
-
1210
- /* compare the private fields */
1211
- if (!methods->nodeEqual(a, b))
1212
- return false;
1213
-
1214
- return true;
1215
- }
1216
-
1217
- /*
1218
- * Stuff from parsenodes.h
1219
- */
1220
-
1221
- static bool
1222
- _equalQuery(const Query *a, const Query *b)
1223
- {
1224
- COMPARE_SCALAR_FIELD(commandType);
1225
- COMPARE_SCALAR_FIELD(querySource);
1226
- /* we intentionally ignore queryId, since it might not be set */
1227
- COMPARE_SCALAR_FIELD(canSetTag);
1228
- COMPARE_NODE_FIELD(utilityStmt);
1229
- COMPARE_SCALAR_FIELD(resultRelation);
1230
- COMPARE_SCALAR_FIELD(hasAggs);
1231
- COMPARE_SCALAR_FIELD(hasWindowFuncs);
1232
- COMPARE_SCALAR_FIELD(hasTargetSRFs);
1233
- COMPARE_SCALAR_FIELD(hasSubLinks);
1234
- COMPARE_SCALAR_FIELD(hasDistinctOn);
1235
- COMPARE_SCALAR_FIELD(hasRecursive);
1236
- COMPARE_SCALAR_FIELD(hasModifyingCTE);
1237
- COMPARE_SCALAR_FIELD(hasForUpdate);
1238
- COMPARE_SCALAR_FIELD(hasRowSecurity);
1239
- COMPARE_SCALAR_FIELD(isReturn);
1240
- COMPARE_NODE_FIELD(cteList);
1241
- COMPARE_NODE_FIELD(rtable);
1242
- COMPARE_NODE_FIELD(jointree);
1243
- COMPARE_NODE_FIELD(targetList);
1244
- COMPARE_SCALAR_FIELD(override);
1245
- COMPARE_NODE_FIELD(onConflict);
1246
- COMPARE_NODE_FIELD(returningList);
1247
- COMPARE_NODE_FIELD(groupClause);
1248
- COMPARE_SCALAR_FIELD(groupDistinct);
1249
- COMPARE_NODE_FIELD(groupingSets);
1250
- COMPARE_NODE_FIELD(havingQual);
1251
- COMPARE_NODE_FIELD(windowClause);
1252
- COMPARE_NODE_FIELD(distinctClause);
1253
- COMPARE_NODE_FIELD(sortClause);
1254
- COMPARE_NODE_FIELD(limitOffset);
1255
- COMPARE_NODE_FIELD(limitCount);
1256
- COMPARE_SCALAR_FIELD(limitOption);
1257
- COMPARE_NODE_FIELD(rowMarks);
1258
- COMPARE_NODE_FIELD(setOperations);
1259
- COMPARE_NODE_FIELD(constraintDeps);
1260
- COMPARE_NODE_FIELD(withCheckOptions);
1261
- COMPARE_NODE_FIELD(mergeActionList);
1262
- COMPARE_SCALAR_FIELD(mergeUseOuterJoin);
1263
- COMPARE_LOCATION_FIELD(stmt_location);
1264
- COMPARE_SCALAR_FIELD(stmt_len);
1265
-
1266
- return true;
1267
- }
1268
-
1269
- static bool
1270
- _equalRawStmt(const RawStmt *a, const RawStmt *b)
1271
- {
1272
- COMPARE_NODE_FIELD(stmt);
1273
- COMPARE_LOCATION_FIELD(stmt_location);
1274
- COMPARE_SCALAR_FIELD(stmt_len);
1275
-
1276
- return true;
1277
- }
1278
-
1279
- static bool
1280
- _equalInsertStmt(const InsertStmt *a, const InsertStmt *b)
1281
- {
1282
- COMPARE_NODE_FIELD(relation);
1283
- COMPARE_NODE_FIELD(cols);
1284
- COMPARE_NODE_FIELD(selectStmt);
1285
- COMPARE_NODE_FIELD(onConflictClause);
1286
- COMPARE_NODE_FIELD(returningList);
1287
- COMPARE_NODE_FIELD(withClause);
1288
- COMPARE_SCALAR_FIELD(override);
1289
-
1290
- return true;
1291
- }
1292
-
1293
- static bool
1294
- _equalDeleteStmt(const DeleteStmt *a, const DeleteStmt *b)
1295
- {
1296
- COMPARE_NODE_FIELD(relation);
1297
- COMPARE_NODE_FIELD(usingClause);
1298
- COMPARE_NODE_FIELD(whereClause);
1299
- COMPARE_NODE_FIELD(returningList);
1300
- COMPARE_NODE_FIELD(withClause);
1301
-
1302
- return true;
1303
- }
1304
-
1305
- static bool
1306
- _equalUpdateStmt(const UpdateStmt *a, const UpdateStmt *b)
1307
- {
1308
- COMPARE_NODE_FIELD(relation);
1309
- COMPARE_NODE_FIELD(targetList);
1310
- COMPARE_NODE_FIELD(whereClause);
1311
- COMPARE_NODE_FIELD(fromClause);
1312
- COMPARE_NODE_FIELD(returningList);
1313
- COMPARE_NODE_FIELD(withClause);
1314
-
1315
- return true;
1316
- }
1317
-
1318
- static bool
1319
- _equalMergeStmt(const MergeStmt *a, const MergeStmt *b)
1320
- {
1321
- COMPARE_NODE_FIELD(relation);
1322
- COMPARE_NODE_FIELD(sourceRelation);
1323
- COMPARE_NODE_FIELD(joinCondition);
1324
- COMPARE_NODE_FIELD(mergeWhenClauses);
1325
- COMPARE_NODE_FIELD(withClause);
1326
-
1327
- return true;
1328
- }
1329
-
1330
- static bool
1331
- _equalSelectStmt(const SelectStmt *a, const SelectStmt *b)
1332
- {
1333
- COMPARE_NODE_FIELD(distinctClause);
1334
- COMPARE_NODE_FIELD(intoClause);
1335
- COMPARE_NODE_FIELD(targetList);
1336
- COMPARE_NODE_FIELD(fromClause);
1337
- COMPARE_NODE_FIELD(whereClause);
1338
- COMPARE_NODE_FIELD(groupClause);
1339
- COMPARE_SCALAR_FIELD(groupDistinct);
1340
- COMPARE_NODE_FIELD(havingClause);
1341
- COMPARE_NODE_FIELD(windowClause);
1342
- COMPARE_NODE_FIELD(valuesLists);
1343
- COMPARE_NODE_FIELD(sortClause);
1344
- COMPARE_NODE_FIELD(limitOffset);
1345
- COMPARE_NODE_FIELD(limitCount);
1346
- COMPARE_SCALAR_FIELD(limitOption);
1347
- COMPARE_NODE_FIELD(lockingClause);
1348
- COMPARE_NODE_FIELD(withClause);
1349
- COMPARE_SCALAR_FIELD(op);
1350
- COMPARE_SCALAR_FIELD(all);
1351
- COMPARE_NODE_FIELD(larg);
1352
- COMPARE_NODE_FIELD(rarg);
1353
-
1354
- return true;
1355
- }
1356
-
1357
- static bool
1358
- _equalSetOperationStmt(const SetOperationStmt *a, const SetOperationStmt *b)
1359
- {
1360
- COMPARE_SCALAR_FIELD(op);
1361
- COMPARE_SCALAR_FIELD(all);
1362
- COMPARE_NODE_FIELD(larg);
1363
- COMPARE_NODE_FIELD(rarg);
1364
- COMPARE_NODE_FIELD(colTypes);
1365
- COMPARE_NODE_FIELD(colTypmods);
1366
- COMPARE_NODE_FIELD(colCollations);
1367
- COMPARE_NODE_FIELD(groupClauses);
1368
-
1369
- return true;
1370
- }
1371
-
1372
- static bool
1373
- _equalReturnStmt(const ReturnStmt *a, const ReturnStmt *b)
1374
- {
1375
- COMPARE_NODE_FIELD(returnval);
1376
-
1377
- return true;
1378
- }
1379
-
1380
- static bool
1381
- _equalPLAssignStmt(const PLAssignStmt *a, const PLAssignStmt *b)
1382
- {
1383
- COMPARE_STRING_FIELD(name);
1384
- COMPARE_NODE_FIELD(indirection);
1385
- COMPARE_SCALAR_FIELD(nnames);
1386
- COMPARE_NODE_FIELD(val);
1387
- COMPARE_LOCATION_FIELD(location);
1388
-
1389
- return true;
1390
- }
1391
-
1392
- static bool
1393
- _equalAlterTableStmt(const AlterTableStmt *a, const AlterTableStmt *b)
1394
- {
1395
- COMPARE_NODE_FIELD(relation);
1396
- COMPARE_NODE_FIELD(cmds);
1397
- COMPARE_SCALAR_FIELD(objtype);
1398
- COMPARE_SCALAR_FIELD(missing_ok);
1399
-
1400
- return true;
1401
- }
1402
-
1403
- static bool
1404
- _equalAlterTableCmd(const AlterTableCmd *a, const AlterTableCmd *b)
1405
- {
1406
- COMPARE_SCALAR_FIELD(subtype);
1407
- COMPARE_STRING_FIELD(name);
1408
- COMPARE_SCALAR_FIELD(num);
1409
- COMPARE_NODE_FIELD(newowner);
1410
- COMPARE_NODE_FIELD(def);
1411
- COMPARE_SCALAR_FIELD(behavior);
1412
- COMPARE_SCALAR_FIELD(missing_ok);
1413
- COMPARE_SCALAR_FIELD(recurse);
1414
-
1415
- return true;
1416
- }
1417
-
1418
- static bool
1419
- _equalAlterCollationStmt(const AlterCollationStmt *a, const AlterCollationStmt *b)
1420
- {
1421
- COMPARE_NODE_FIELD(collname);
1422
-
1423
- return true;
1424
- }
1425
-
1426
- static bool
1427
- _equalAlterDomainStmt(const AlterDomainStmt *a, const AlterDomainStmt *b)
1428
- {
1429
- COMPARE_SCALAR_FIELD(subtype);
1430
- COMPARE_NODE_FIELD(typeName);
1431
- COMPARE_STRING_FIELD(name);
1432
- COMPARE_NODE_FIELD(def);
1433
- COMPARE_SCALAR_FIELD(behavior);
1434
- COMPARE_SCALAR_FIELD(missing_ok);
1435
-
1436
- return true;
1437
- }
1438
-
1439
- static bool
1440
- _equalGrantStmt(const GrantStmt *a, const GrantStmt *b)
1441
- {
1442
- COMPARE_SCALAR_FIELD(is_grant);
1443
- COMPARE_SCALAR_FIELD(targtype);
1444
- COMPARE_SCALAR_FIELD(objtype);
1445
- COMPARE_NODE_FIELD(objects);
1446
- COMPARE_NODE_FIELD(privileges);
1447
- COMPARE_NODE_FIELD(grantees);
1448
- COMPARE_SCALAR_FIELD(grant_option);
1449
- COMPARE_NODE_FIELD(grantor);
1450
- COMPARE_SCALAR_FIELD(behavior);
1451
-
1452
- return true;
1453
- }
1454
-
1455
- static bool
1456
- _equalObjectWithArgs(const ObjectWithArgs *a, const ObjectWithArgs *b)
1457
- {
1458
- COMPARE_NODE_FIELD(objname);
1459
- COMPARE_NODE_FIELD(objargs);
1460
- COMPARE_NODE_FIELD(objfuncargs);
1461
- COMPARE_SCALAR_FIELD(args_unspecified);
1462
-
1463
- return true;
1464
- }
1465
-
1466
- static bool
1467
- _equalAccessPriv(const AccessPriv *a, const AccessPriv *b)
1468
- {
1469
- COMPARE_STRING_FIELD(priv_name);
1470
- COMPARE_NODE_FIELD(cols);
1471
-
1472
- return true;
1473
- }
1474
-
1475
- static bool
1476
- _equalGrantRoleStmt(const GrantRoleStmt *a, const GrantRoleStmt *b)
1477
- {
1478
- COMPARE_NODE_FIELD(granted_roles);
1479
- COMPARE_NODE_FIELD(grantee_roles);
1480
- COMPARE_SCALAR_FIELD(is_grant);
1481
- COMPARE_SCALAR_FIELD(admin_opt);
1482
- COMPARE_NODE_FIELD(grantor);
1483
- COMPARE_SCALAR_FIELD(behavior);
1484
-
1485
- return true;
1486
- }
1487
-
1488
- static bool
1489
- _equalAlterDefaultPrivilegesStmt(const AlterDefaultPrivilegesStmt *a, const AlterDefaultPrivilegesStmt *b)
1490
- {
1491
- COMPARE_NODE_FIELD(options);
1492
- COMPARE_NODE_FIELD(action);
1493
-
1494
- return true;
1495
- }
1496
-
1497
- static bool
1498
- _equalDeclareCursorStmt(const DeclareCursorStmt *a, const DeclareCursorStmt *b)
1499
- {
1500
- COMPARE_STRING_FIELD(portalname);
1501
- COMPARE_SCALAR_FIELD(options);
1502
- COMPARE_NODE_FIELD(query);
1503
-
1504
- return true;
1505
- }
1506
-
1507
- static bool
1508
- _equalClosePortalStmt(const ClosePortalStmt *a, const ClosePortalStmt *b)
1509
- {
1510
- COMPARE_STRING_FIELD(portalname);
1511
-
1512
- return true;
1513
- }
1514
-
1515
- static bool
1516
- _equalCallStmt(const CallStmt *a, const CallStmt *b)
1517
- {
1518
- COMPARE_NODE_FIELD(funccall);
1519
- COMPARE_NODE_FIELD(funcexpr);
1520
- COMPARE_NODE_FIELD(outargs);
1521
-
1522
- return true;
1523
- }
1524
-
1525
- static bool
1526
- _equalClusterStmt(const ClusterStmt *a, const ClusterStmt *b)
1527
- {
1528
- COMPARE_NODE_FIELD(relation);
1529
- COMPARE_STRING_FIELD(indexname);
1530
- COMPARE_NODE_FIELD(params);
1531
-
1532
- return true;
1533
- }
1534
-
1535
- static bool
1536
- _equalCopyStmt(const CopyStmt *a, const CopyStmt *b)
1537
- {
1538
- COMPARE_NODE_FIELD(relation);
1539
- COMPARE_NODE_FIELD(query);
1540
- COMPARE_NODE_FIELD(attlist);
1541
- COMPARE_SCALAR_FIELD(is_from);
1542
- COMPARE_SCALAR_FIELD(is_program);
1543
- COMPARE_STRING_FIELD(filename);
1544
- COMPARE_NODE_FIELD(options);
1545
- COMPARE_NODE_FIELD(whereClause);
1546
-
1547
- return true;
1548
- }
1549
-
1550
- static bool
1551
- _equalCreateStmt(const CreateStmt *a, const CreateStmt *b)
1552
- {
1553
- COMPARE_NODE_FIELD(relation);
1554
- COMPARE_NODE_FIELD(tableElts);
1555
- COMPARE_NODE_FIELD(inhRelations);
1556
- COMPARE_NODE_FIELD(partbound);
1557
- COMPARE_NODE_FIELD(partspec);
1558
- COMPARE_NODE_FIELD(ofTypename);
1559
- COMPARE_NODE_FIELD(constraints);
1560
- COMPARE_NODE_FIELD(options);
1561
- COMPARE_SCALAR_FIELD(oncommit);
1562
- COMPARE_STRING_FIELD(tablespacename);
1563
- COMPARE_STRING_FIELD(accessMethod);
1564
- COMPARE_SCALAR_FIELD(if_not_exists);
1565
-
1566
- return true;
1567
- }
1568
-
1569
- static bool
1570
- _equalTableLikeClause(const TableLikeClause *a, const TableLikeClause *b)
1571
- {
1572
- COMPARE_NODE_FIELD(relation);
1573
- COMPARE_SCALAR_FIELD(options);
1574
- COMPARE_SCALAR_FIELD(relationOid);
1575
-
1576
- return true;
1577
- }
1578
-
1579
- static bool
1580
- _equalDefineStmt(const DefineStmt *a, const DefineStmt *b)
1581
- {
1582
- COMPARE_SCALAR_FIELD(kind);
1583
- COMPARE_SCALAR_FIELD(oldstyle);
1584
- COMPARE_NODE_FIELD(defnames);
1585
- COMPARE_NODE_FIELD(args);
1586
- COMPARE_NODE_FIELD(definition);
1587
- COMPARE_SCALAR_FIELD(if_not_exists);
1588
- COMPARE_SCALAR_FIELD(replace);
1589
-
1590
- return true;
1591
- }
1592
-
1593
- static bool
1594
- _equalDropStmt(const DropStmt *a, const DropStmt *b)
1595
- {
1596
- COMPARE_NODE_FIELD(objects);
1597
- COMPARE_SCALAR_FIELD(removeType);
1598
- COMPARE_SCALAR_FIELD(behavior);
1599
- COMPARE_SCALAR_FIELD(missing_ok);
1600
- COMPARE_SCALAR_FIELD(concurrent);
1601
-
1602
- return true;
1603
- }
1604
-
1605
- static bool
1606
- _equalTruncateStmt(const TruncateStmt *a, const TruncateStmt *b)
1607
- {
1608
- COMPARE_NODE_FIELD(relations);
1609
- COMPARE_SCALAR_FIELD(restart_seqs);
1610
- COMPARE_SCALAR_FIELD(behavior);
1611
-
1612
- return true;
1613
- }
1614
-
1615
- static bool
1616
- _equalCommentStmt(const CommentStmt *a, const CommentStmt *b)
1617
- {
1618
- COMPARE_SCALAR_FIELD(objtype);
1619
- COMPARE_NODE_FIELD(object);
1620
- COMPARE_STRING_FIELD(comment);
1621
-
1622
- return true;
1623
- }
1624
-
1625
- static bool
1626
- _equalSecLabelStmt(const SecLabelStmt *a, const SecLabelStmt *b)
1627
- {
1628
- COMPARE_SCALAR_FIELD(objtype);
1629
- COMPARE_NODE_FIELD(object);
1630
- COMPARE_STRING_FIELD(provider);
1631
- COMPARE_STRING_FIELD(label);
1632
-
1633
- return true;
1634
- }
1635
-
1636
- static bool
1637
- _equalFetchStmt(const FetchStmt *a, const FetchStmt *b)
1638
- {
1639
- COMPARE_SCALAR_FIELD(direction);
1640
- COMPARE_SCALAR_FIELD(howMany);
1641
- COMPARE_STRING_FIELD(portalname);
1642
- COMPARE_SCALAR_FIELD(ismove);
1643
-
1644
- return true;
1645
- }
1646
-
1647
- static bool
1648
- _equalIndexStmt(const IndexStmt *a, const IndexStmt *b)
1649
- {
1650
- COMPARE_STRING_FIELD(idxname);
1651
- COMPARE_NODE_FIELD(relation);
1652
- COMPARE_STRING_FIELD(accessMethod);
1653
- COMPARE_STRING_FIELD(tableSpace);
1654
- COMPARE_NODE_FIELD(indexParams);
1655
- COMPARE_NODE_FIELD(indexIncludingParams);
1656
- COMPARE_NODE_FIELD(options);
1657
- COMPARE_NODE_FIELD(whereClause);
1658
- COMPARE_NODE_FIELD(excludeOpNames);
1659
- COMPARE_STRING_FIELD(idxcomment);
1660
- COMPARE_SCALAR_FIELD(indexOid);
1661
- COMPARE_SCALAR_FIELD(oldNode);
1662
- COMPARE_SCALAR_FIELD(oldCreateSubid);
1663
- COMPARE_SCALAR_FIELD(oldFirstRelfilenodeSubid);
1664
- COMPARE_SCALAR_FIELD(unique);
1665
- COMPARE_SCALAR_FIELD(nulls_not_distinct);
1666
- COMPARE_SCALAR_FIELD(primary);
1667
- COMPARE_SCALAR_FIELD(isconstraint);
1668
- COMPARE_SCALAR_FIELD(deferrable);
1669
- COMPARE_SCALAR_FIELD(initdeferred);
1670
- COMPARE_SCALAR_FIELD(transformed);
1671
- COMPARE_SCALAR_FIELD(concurrent);
1672
- COMPARE_SCALAR_FIELD(if_not_exists);
1673
- COMPARE_SCALAR_FIELD(reset_default_tblspc);
1674
-
1675
- return true;
1676
- }
1677
-
1678
- static bool
1679
- _equalCreateStatsStmt(const CreateStatsStmt *a, const CreateStatsStmt *b)
1680
- {
1681
- COMPARE_NODE_FIELD(defnames);
1682
- COMPARE_NODE_FIELD(stat_types);
1683
- COMPARE_NODE_FIELD(exprs);
1684
- COMPARE_NODE_FIELD(relations);
1685
- COMPARE_STRING_FIELD(stxcomment);
1686
- COMPARE_SCALAR_FIELD(transformed);
1687
- COMPARE_SCALAR_FIELD(if_not_exists);
1688
-
1689
- return true;
1690
- }
1691
-
1692
- static bool
1693
- _equalAlterStatsStmt(const AlterStatsStmt *a, const AlterStatsStmt *b)
1694
- {
1695
- COMPARE_NODE_FIELD(defnames);
1696
- COMPARE_SCALAR_FIELD(stxstattarget);
1697
- COMPARE_SCALAR_FIELD(missing_ok);
1698
-
1699
- return true;
1700
- }
1701
-
1702
- static bool
1703
- _equalCreateFunctionStmt(const CreateFunctionStmt *a, const CreateFunctionStmt *b)
1704
- {
1705
- COMPARE_SCALAR_FIELD(is_procedure);
1706
- COMPARE_SCALAR_FIELD(replace);
1707
- COMPARE_NODE_FIELD(funcname);
1708
- COMPARE_NODE_FIELD(parameters);
1709
- COMPARE_NODE_FIELD(returnType);
1710
- COMPARE_NODE_FIELD(options);
1711
- COMPARE_NODE_FIELD(sql_body);
1712
-
1713
- return true;
1714
- }
1715
-
1716
- static bool
1717
- _equalFunctionParameter(const FunctionParameter *a, const FunctionParameter *b)
1718
- {
1719
- COMPARE_STRING_FIELD(name);
1720
- COMPARE_NODE_FIELD(argType);
1721
- COMPARE_SCALAR_FIELD(mode);
1722
- COMPARE_NODE_FIELD(defexpr);
1723
-
1724
- return true;
1725
- }
1726
-
1727
- static bool
1728
- _equalAlterFunctionStmt(const AlterFunctionStmt *a, const AlterFunctionStmt *b)
1729
- {
1730
- COMPARE_SCALAR_FIELD(objtype);
1731
- COMPARE_NODE_FIELD(func);
1732
- COMPARE_NODE_FIELD(actions);
1733
-
1734
- return true;
1735
- }
1736
-
1737
- static bool
1738
- _equalDoStmt(const DoStmt *a, const DoStmt *b)
1739
- {
1740
- COMPARE_NODE_FIELD(args);
1741
-
1742
- return true;
1743
- }
1744
-
1745
- static bool
1746
- _equalRenameStmt(const RenameStmt *a, const RenameStmt *b)
1747
- {
1748
- COMPARE_SCALAR_FIELD(renameType);
1749
- COMPARE_SCALAR_FIELD(relationType);
1750
- COMPARE_NODE_FIELD(relation);
1751
- COMPARE_NODE_FIELD(object);
1752
- COMPARE_STRING_FIELD(subname);
1753
- COMPARE_STRING_FIELD(newname);
1754
- COMPARE_SCALAR_FIELD(behavior);
1755
- COMPARE_SCALAR_FIELD(missing_ok);
1756
-
1757
- return true;
1758
- }
1759
-
1760
- static bool
1761
- _equalAlterObjectDependsStmt(const AlterObjectDependsStmt *a, const AlterObjectDependsStmt *b)
1762
- {
1763
- COMPARE_SCALAR_FIELD(objectType);
1764
- COMPARE_NODE_FIELD(relation);
1765
- COMPARE_NODE_FIELD(object);
1766
- COMPARE_NODE_FIELD(extname);
1767
- COMPARE_SCALAR_FIELD(remove);
1768
-
1769
- return true;
1770
- }
1771
-
1772
- static bool
1773
- _equalAlterObjectSchemaStmt(const AlterObjectSchemaStmt *a, const AlterObjectSchemaStmt *b)
1774
- {
1775
- COMPARE_SCALAR_FIELD(objectType);
1776
- COMPARE_NODE_FIELD(relation);
1777
- COMPARE_NODE_FIELD(object);
1778
- COMPARE_STRING_FIELD(newschema);
1779
- COMPARE_SCALAR_FIELD(missing_ok);
1780
-
1781
- return true;
1782
- }
1783
-
1784
- static bool
1785
- _equalAlterOwnerStmt(const AlterOwnerStmt *a, const AlterOwnerStmt *b)
1786
- {
1787
- COMPARE_SCALAR_FIELD(objectType);
1788
- COMPARE_NODE_FIELD(relation);
1789
- COMPARE_NODE_FIELD(object);
1790
- COMPARE_NODE_FIELD(newowner);
1791
-
1792
- return true;
1793
- }
1794
-
1795
- static bool
1796
- _equalAlterOperatorStmt(const AlterOperatorStmt *a, const AlterOperatorStmt *b)
1797
- {
1798
- COMPARE_NODE_FIELD(opername);
1799
- COMPARE_NODE_FIELD(options);
1800
-
1801
- return true;
1802
- }
1803
-
1804
- static bool
1805
- _equalAlterTypeStmt(const AlterTypeStmt *a, const AlterTypeStmt *b)
1806
- {
1807
- COMPARE_NODE_FIELD(typeName);
1808
- COMPARE_NODE_FIELD(options);
1809
-
1810
- return true;
1811
- }
1812
-
1813
- static bool
1814
- _equalRuleStmt(const RuleStmt *a, const RuleStmt *b)
1815
- {
1816
- COMPARE_NODE_FIELD(relation);
1817
- COMPARE_STRING_FIELD(rulename);
1818
- COMPARE_NODE_FIELD(whereClause);
1819
- COMPARE_SCALAR_FIELD(event);
1820
- COMPARE_SCALAR_FIELD(instead);
1821
- COMPARE_NODE_FIELD(actions);
1822
- COMPARE_SCALAR_FIELD(replace);
1823
-
1824
- return true;
1825
- }
1826
-
1827
- static bool
1828
- _equalNotifyStmt(const NotifyStmt *a, const NotifyStmt *b)
1829
- {
1830
- COMPARE_STRING_FIELD(conditionname);
1831
- COMPARE_STRING_FIELD(payload);
1832
-
1833
- return true;
1834
- }
1835
-
1836
- static bool
1837
- _equalListenStmt(const ListenStmt *a, const ListenStmt *b)
1838
- {
1839
- COMPARE_STRING_FIELD(conditionname);
1840
-
1841
- return true;
1842
- }
1843
-
1844
- static bool
1845
- _equalUnlistenStmt(const UnlistenStmt *a, const UnlistenStmt *b)
1846
- {
1847
- COMPARE_STRING_FIELD(conditionname);
1848
-
1849
- return true;
1850
- }
1851
-
1852
- static bool
1853
- _equalTransactionStmt(const TransactionStmt *a, const TransactionStmt *b)
1854
- {
1855
- COMPARE_SCALAR_FIELD(kind);
1856
- COMPARE_NODE_FIELD(options);
1857
- COMPARE_STRING_FIELD(savepoint_name);
1858
- COMPARE_STRING_FIELD(gid);
1859
- COMPARE_SCALAR_FIELD(chain);
1860
-
1861
- return true;
1862
- }
1863
-
1864
- static bool
1865
- _equalCompositeTypeStmt(const CompositeTypeStmt *a, const CompositeTypeStmt *b)
1866
- {
1867
- COMPARE_NODE_FIELD(typevar);
1868
- COMPARE_NODE_FIELD(coldeflist);
1869
-
1870
- return true;
1871
- }
1872
-
1873
- static bool
1874
- _equalCreateEnumStmt(const CreateEnumStmt *a, const CreateEnumStmt *b)
1875
- {
1876
- COMPARE_NODE_FIELD(typeName);
1877
- COMPARE_NODE_FIELD(vals);
1878
-
1879
- return true;
1880
- }
1881
-
1882
- static bool
1883
- _equalCreateRangeStmt(const CreateRangeStmt *a, const CreateRangeStmt *b)
1884
- {
1885
- COMPARE_NODE_FIELD(typeName);
1886
- COMPARE_NODE_FIELD(params);
1887
-
1888
- return true;
1889
- }
1890
-
1891
- static bool
1892
- _equalAlterEnumStmt(const AlterEnumStmt *a, const AlterEnumStmt *b)
1893
- {
1894
- COMPARE_NODE_FIELD(typeName);
1895
- COMPARE_STRING_FIELD(oldVal);
1896
- COMPARE_STRING_FIELD(newVal);
1897
- COMPARE_STRING_FIELD(newValNeighbor);
1898
- COMPARE_SCALAR_FIELD(newValIsAfter);
1899
- COMPARE_SCALAR_FIELD(skipIfNewValExists);
1900
-
1901
- return true;
1902
- }
1903
-
1904
- static bool
1905
- _equalViewStmt(const ViewStmt *a, const ViewStmt *b)
1906
- {
1907
- COMPARE_NODE_FIELD(view);
1908
- COMPARE_NODE_FIELD(aliases);
1909
- COMPARE_NODE_FIELD(query);
1910
- COMPARE_SCALAR_FIELD(replace);
1911
- COMPARE_NODE_FIELD(options);
1912
- COMPARE_SCALAR_FIELD(withCheckOption);
1913
-
1914
- return true;
1915
- }
1916
-
1917
- static bool
1918
- _equalLoadStmt(const LoadStmt *a, const LoadStmt *b)
1919
- {
1920
- COMPARE_STRING_FIELD(filename);
1921
-
1922
- return true;
1923
- }
1924
-
1925
- static bool
1926
- _equalCreateDomainStmt(const CreateDomainStmt *a, const CreateDomainStmt *b)
1927
- {
1928
- COMPARE_NODE_FIELD(domainname);
1929
- COMPARE_NODE_FIELD(typeName);
1930
- COMPARE_NODE_FIELD(collClause);
1931
- COMPARE_NODE_FIELD(constraints);
1932
-
1933
- return true;
1934
- }
1935
-
1936
- static bool
1937
- _equalCreateOpClassStmt(const CreateOpClassStmt *a, const CreateOpClassStmt *b)
1938
- {
1939
- COMPARE_NODE_FIELD(opclassname);
1940
- COMPARE_NODE_FIELD(opfamilyname);
1941
- COMPARE_STRING_FIELD(amname);
1942
- COMPARE_NODE_FIELD(datatype);
1943
- COMPARE_NODE_FIELD(items);
1944
- COMPARE_SCALAR_FIELD(isDefault);
1945
-
1946
- return true;
1947
- }
1948
-
1949
- static bool
1950
- _equalCreateOpClassItem(const CreateOpClassItem *a, const CreateOpClassItem *b)
1951
- {
1952
- COMPARE_SCALAR_FIELD(itemtype);
1953
- COMPARE_NODE_FIELD(name);
1954
- COMPARE_SCALAR_FIELD(number);
1955
- COMPARE_NODE_FIELD(order_family);
1956
- COMPARE_NODE_FIELD(class_args);
1957
- COMPARE_NODE_FIELD(storedtype);
1958
-
1959
- return true;
1960
- }
1961
-
1962
- static bool
1963
- _equalCreateOpFamilyStmt(const CreateOpFamilyStmt *a, const CreateOpFamilyStmt *b)
1964
- {
1965
- COMPARE_NODE_FIELD(opfamilyname);
1966
- COMPARE_STRING_FIELD(amname);
1967
-
1968
- return true;
1969
- }
1970
-
1971
- static bool
1972
- _equalAlterOpFamilyStmt(const AlterOpFamilyStmt *a, const AlterOpFamilyStmt *b)
1973
- {
1974
- COMPARE_NODE_FIELD(opfamilyname);
1975
- COMPARE_STRING_FIELD(amname);
1976
- COMPARE_SCALAR_FIELD(isDrop);
1977
- COMPARE_NODE_FIELD(items);
1978
-
1979
- return true;
1980
- }
1981
-
1982
- static bool
1983
- _equalCreatedbStmt(const CreatedbStmt *a, const CreatedbStmt *b)
1984
- {
1985
- COMPARE_STRING_FIELD(dbname);
1986
- COMPARE_NODE_FIELD(options);
1987
-
1988
- return true;
1989
- }
1990
-
1991
- static bool
1992
- _equalAlterDatabaseStmt(const AlterDatabaseStmt *a, const AlterDatabaseStmt *b)
1993
- {
1994
- COMPARE_STRING_FIELD(dbname);
1995
- COMPARE_NODE_FIELD(options);
1996
-
1997
- return true;
1998
- }
1999
-
2000
- static bool
2001
- _equalAlterDatabaseRefreshCollStmt(const AlterDatabaseRefreshCollStmt *a, const AlterDatabaseRefreshCollStmt *b)
2002
- {
2003
- COMPARE_STRING_FIELD(dbname);
2004
-
2005
- return true;
2006
- }
2007
-
2008
- static bool
2009
- _equalAlterDatabaseSetStmt(const AlterDatabaseSetStmt *a, const AlterDatabaseSetStmt *b)
2010
- {
2011
- COMPARE_STRING_FIELD(dbname);
2012
- COMPARE_NODE_FIELD(setstmt);
2013
-
2014
- return true;
2015
- }
2016
-
2017
- static bool
2018
- _equalDropdbStmt(const DropdbStmt *a, const DropdbStmt *b)
2019
- {
2020
- COMPARE_STRING_FIELD(dbname);
2021
- COMPARE_SCALAR_FIELD(missing_ok);
2022
- COMPARE_NODE_FIELD(options);
2023
-
2024
- return true;
2025
- }
2026
-
2027
- static bool
2028
- _equalVacuumStmt(const VacuumStmt *a, const VacuumStmt *b)
2029
- {
2030
- COMPARE_NODE_FIELD(options);
2031
- COMPARE_NODE_FIELD(rels);
2032
- COMPARE_SCALAR_FIELD(is_vacuumcmd);
2033
-
2034
- return true;
2035
- }
2036
-
2037
- static bool
2038
- _equalVacuumRelation(const VacuumRelation *a, const VacuumRelation *b)
2039
- {
2040
- COMPARE_NODE_FIELD(relation);
2041
- COMPARE_SCALAR_FIELD(oid);
2042
- COMPARE_NODE_FIELD(va_cols);
2043
-
2044
- return true;
2045
- }
2046
-
2047
- static bool
2048
- _equalExplainStmt(const ExplainStmt *a, const ExplainStmt *b)
2049
- {
2050
- COMPARE_NODE_FIELD(query);
2051
- COMPARE_NODE_FIELD(options);
2052
-
2053
- return true;
2054
- }
2055
-
2056
- static bool
2057
- _equalCreateTableAsStmt(const CreateTableAsStmt *a, const CreateTableAsStmt *b)
2058
- {
2059
- COMPARE_NODE_FIELD(query);
2060
- COMPARE_NODE_FIELD(into);
2061
- COMPARE_SCALAR_FIELD(objtype);
2062
- COMPARE_SCALAR_FIELD(is_select_into);
2063
- COMPARE_SCALAR_FIELD(if_not_exists);
2064
-
2065
- return true;
2066
- }
2067
-
2068
- static bool
2069
- _equalRefreshMatViewStmt(const RefreshMatViewStmt *a, const RefreshMatViewStmt *b)
2070
- {
2071
- COMPARE_SCALAR_FIELD(concurrent);
2072
- COMPARE_SCALAR_FIELD(skipData);
2073
- COMPARE_NODE_FIELD(relation);
2074
-
2075
- return true;
2076
- }
2077
-
2078
- static bool
2079
- _equalReplicaIdentityStmt(const ReplicaIdentityStmt *a, const ReplicaIdentityStmt *b)
2080
- {
2081
- COMPARE_SCALAR_FIELD(identity_type);
2082
- COMPARE_STRING_FIELD(name);
2083
-
2084
- return true;
2085
- }
2086
-
2087
- static bool
2088
- _equalAlterSystemStmt(const AlterSystemStmt *a, const AlterSystemStmt *b)
2089
- {
2090
- COMPARE_NODE_FIELD(setstmt);
2091
-
2092
- return true;
2093
- }
2094
-
2095
-
2096
- static bool
2097
- _equalCreateSeqStmt(const CreateSeqStmt *a, const CreateSeqStmt *b)
2098
- {
2099
- COMPARE_NODE_FIELD(sequence);
2100
- COMPARE_NODE_FIELD(options);
2101
- COMPARE_SCALAR_FIELD(ownerId);
2102
- COMPARE_SCALAR_FIELD(for_identity);
2103
- COMPARE_SCALAR_FIELD(if_not_exists);
2104
-
2105
- return true;
2106
- }
2107
-
2108
- static bool
2109
- _equalAlterSeqStmt(const AlterSeqStmt *a, const AlterSeqStmt *b)
2110
- {
2111
- COMPARE_NODE_FIELD(sequence);
2112
- COMPARE_NODE_FIELD(options);
2113
- COMPARE_SCALAR_FIELD(for_identity);
2114
- COMPARE_SCALAR_FIELD(missing_ok);
2115
-
2116
- return true;
2117
- }
2118
-
2119
- static bool
2120
- _equalVariableSetStmt(const VariableSetStmt *a, const VariableSetStmt *b)
2121
- {
2122
- COMPARE_SCALAR_FIELD(kind);
2123
- COMPARE_STRING_FIELD(name);
2124
- COMPARE_NODE_FIELD(args);
2125
- COMPARE_SCALAR_FIELD(is_local);
2126
-
2127
- return true;
2128
- }
2129
-
2130
- static bool
2131
- _equalVariableShowStmt(const VariableShowStmt *a, const VariableShowStmt *b)
2132
- {
2133
- COMPARE_STRING_FIELD(name);
2134
-
2135
- return true;
2136
- }
2137
-
2138
- static bool
2139
- _equalDiscardStmt(const DiscardStmt *a, const DiscardStmt *b)
2140
- {
2141
- COMPARE_SCALAR_FIELD(target);
2142
-
2143
- return true;
2144
- }
2145
-
2146
- static bool
2147
- _equalCreateTableSpaceStmt(const CreateTableSpaceStmt *a, const CreateTableSpaceStmt *b)
2148
- {
2149
- COMPARE_STRING_FIELD(tablespacename);
2150
- COMPARE_NODE_FIELD(owner);
2151
- COMPARE_STRING_FIELD(location);
2152
- COMPARE_NODE_FIELD(options);
2153
-
2154
- return true;
2155
- }
2156
-
2157
- static bool
2158
- _equalDropTableSpaceStmt(const DropTableSpaceStmt *a, const DropTableSpaceStmt *b)
2159
- {
2160
- COMPARE_STRING_FIELD(tablespacename);
2161
- COMPARE_SCALAR_FIELD(missing_ok);
2162
-
2163
- return true;
2164
- }
2165
-
2166
- static bool
2167
- _equalAlterTableSpaceOptionsStmt(const AlterTableSpaceOptionsStmt *a,
2168
- const AlterTableSpaceOptionsStmt *b)
2169
- {
2170
- COMPARE_STRING_FIELD(tablespacename);
2171
- COMPARE_NODE_FIELD(options);
2172
- COMPARE_SCALAR_FIELD(isReset);
2173
-
2174
- return true;
2175
- }
2176
-
2177
- static bool
2178
- _equalAlterTableMoveAllStmt(const AlterTableMoveAllStmt *a,
2179
- const AlterTableMoveAllStmt *b)
2180
- {
2181
- COMPARE_STRING_FIELD(orig_tablespacename);
2182
- COMPARE_SCALAR_FIELD(objtype);
2183
- COMPARE_NODE_FIELD(roles);
2184
- COMPARE_STRING_FIELD(new_tablespacename);
2185
- COMPARE_SCALAR_FIELD(nowait);
2186
-
2187
- return true;
2188
- }
2189
-
2190
- static bool
2191
- _equalCreateExtensionStmt(const CreateExtensionStmt *a, const CreateExtensionStmt *b)
2192
- {
2193
- COMPARE_STRING_FIELD(extname);
2194
- COMPARE_SCALAR_FIELD(if_not_exists);
2195
- COMPARE_NODE_FIELD(options);
2196
-
2197
- return true;
2198
- }
2199
-
2200
- static bool
2201
- _equalAlterExtensionStmt(const AlterExtensionStmt *a, const AlterExtensionStmt *b)
2202
- {
2203
- COMPARE_STRING_FIELD(extname);
2204
- COMPARE_NODE_FIELD(options);
2205
-
2206
- return true;
2207
- }
2208
-
2209
- static bool
2210
- _equalAlterExtensionContentsStmt(const AlterExtensionContentsStmt *a, const AlterExtensionContentsStmt *b)
2211
- {
2212
- COMPARE_STRING_FIELD(extname);
2213
- COMPARE_SCALAR_FIELD(action);
2214
- COMPARE_SCALAR_FIELD(objtype);
2215
- COMPARE_NODE_FIELD(object);
2216
-
2217
- return true;
2218
- }
2219
-
2220
- static bool
2221
- _equalCreateFdwStmt(const CreateFdwStmt *a, const CreateFdwStmt *b)
2222
- {
2223
- COMPARE_STRING_FIELD(fdwname);
2224
- COMPARE_NODE_FIELD(func_options);
2225
- COMPARE_NODE_FIELD(options);
2226
-
2227
- return true;
2228
- }
2229
-
2230
- static bool
2231
- _equalAlterFdwStmt(const AlterFdwStmt *a, const AlterFdwStmt *b)
2232
- {
2233
- COMPARE_STRING_FIELD(fdwname);
2234
- COMPARE_NODE_FIELD(func_options);
2235
- COMPARE_NODE_FIELD(options);
2236
-
2237
- return true;
2238
- }
2239
-
2240
- static bool
2241
- _equalCreateForeignServerStmt(const CreateForeignServerStmt *a, const CreateForeignServerStmt *b)
2242
- {
2243
- COMPARE_STRING_FIELD(servername);
2244
- COMPARE_STRING_FIELD(servertype);
2245
- COMPARE_STRING_FIELD(version);
2246
- COMPARE_STRING_FIELD(fdwname);
2247
- COMPARE_SCALAR_FIELD(if_not_exists);
2248
- COMPARE_NODE_FIELD(options);
2249
-
2250
- return true;
2251
- }
2252
-
2253
- static bool
2254
- _equalAlterForeignServerStmt(const AlterForeignServerStmt *a, const AlterForeignServerStmt *b)
2255
- {
2256
- COMPARE_STRING_FIELD(servername);
2257
- COMPARE_STRING_FIELD(version);
2258
- COMPARE_NODE_FIELD(options);
2259
- COMPARE_SCALAR_FIELD(has_version);
2260
-
2261
- return true;
2262
- }
2263
-
2264
- static bool
2265
- _equalCreateUserMappingStmt(const CreateUserMappingStmt *a, const CreateUserMappingStmt *b)
2266
- {
2267
- COMPARE_NODE_FIELD(user);
2268
- COMPARE_STRING_FIELD(servername);
2269
- COMPARE_SCALAR_FIELD(if_not_exists);
2270
- COMPARE_NODE_FIELD(options);
2271
-
2272
- return true;
2273
- }
2274
-
2275
- static bool
2276
- _equalAlterUserMappingStmt(const AlterUserMappingStmt *a, const AlterUserMappingStmt *b)
2277
- {
2278
- COMPARE_NODE_FIELD(user);
2279
- COMPARE_STRING_FIELD(servername);
2280
- COMPARE_NODE_FIELD(options);
2281
-
2282
- return true;
2283
- }
2284
-
2285
- static bool
2286
- _equalDropUserMappingStmt(const DropUserMappingStmt *a, const DropUserMappingStmt *b)
2287
- {
2288
- COMPARE_NODE_FIELD(user);
2289
- COMPARE_STRING_FIELD(servername);
2290
- COMPARE_SCALAR_FIELD(missing_ok);
2291
-
2292
- return true;
2293
- }
2294
-
2295
- static bool
2296
- _equalCreateForeignTableStmt(const CreateForeignTableStmt *a, const CreateForeignTableStmt *b)
2297
- {
2298
- if (!_equalCreateStmt(&a->base, &b->base))
2299
- return false;
2300
-
2301
- COMPARE_STRING_FIELD(servername);
2302
- COMPARE_NODE_FIELD(options);
2303
-
2304
- return true;
2305
- }
2306
-
2307
- static bool
2308
- _equalImportForeignSchemaStmt(const ImportForeignSchemaStmt *a, const ImportForeignSchemaStmt *b)
2309
- {
2310
- COMPARE_STRING_FIELD(server_name);
2311
- COMPARE_STRING_FIELD(remote_schema);
2312
- COMPARE_STRING_FIELD(local_schema);
2313
- COMPARE_SCALAR_FIELD(list_type);
2314
- COMPARE_NODE_FIELD(table_list);
2315
- COMPARE_NODE_FIELD(options);
2316
-
2317
- return true;
2318
- }
2319
-
2320
- static bool
2321
- _equalCreateTransformStmt(const CreateTransformStmt *a, const CreateTransformStmt *b)
2322
- {
2323
- COMPARE_SCALAR_FIELD(replace);
2324
- COMPARE_NODE_FIELD(type_name);
2325
- COMPARE_STRING_FIELD(lang);
2326
- COMPARE_NODE_FIELD(fromsql);
2327
- COMPARE_NODE_FIELD(tosql);
2328
-
2329
- return true;
2330
- }
2331
-
2332
- static bool
2333
- _equalCreateAmStmt(const CreateAmStmt *a, const CreateAmStmt *b)
2334
- {
2335
- COMPARE_STRING_FIELD(amname);
2336
- COMPARE_NODE_FIELD(handler_name);
2337
- COMPARE_SCALAR_FIELD(amtype);
2338
-
2339
- return true;
2340
- }
2341
-
2342
- static bool
2343
- _equalCreateTrigStmt(const CreateTrigStmt *a, const CreateTrigStmt *b)
2344
- {
2345
- COMPARE_SCALAR_FIELD(replace);
2346
- COMPARE_SCALAR_FIELD(isconstraint);
2347
- COMPARE_STRING_FIELD(trigname);
2348
- COMPARE_NODE_FIELD(relation);
2349
- COMPARE_NODE_FIELD(funcname);
2350
- COMPARE_NODE_FIELD(args);
2351
- COMPARE_SCALAR_FIELD(row);
2352
- COMPARE_SCALAR_FIELD(timing);
2353
- COMPARE_SCALAR_FIELD(events);
2354
- COMPARE_NODE_FIELD(columns);
2355
- COMPARE_NODE_FIELD(whenClause);
2356
- COMPARE_NODE_FIELD(transitionRels);
2357
- COMPARE_SCALAR_FIELD(deferrable);
2358
- COMPARE_SCALAR_FIELD(initdeferred);
2359
- COMPARE_NODE_FIELD(constrrel);
2360
-
2361
- return true;
2362
- }
2363
-
2364
- static bool
2365
- _equalCreateEventTrigStmt(const CreateEventTrigStmt *a, const CreateEventTrigStmt *b)
2366
- {
2367
- COMPARE_STRING_FIELD(trigname);
2368
- COMPARE_STRING_FIELD(eventname);
2369
- COMPARE_NODE_FIELD(whenclause);
2370
- COMPARE_NODE_FIELD(funcname);
2371
-
2372
- return true;
2373
- }
2374
-
2375
- static bool
2376
- _equalAlterEventTrigStmt(const AlterEventTrigStmt *a, const AlterEventTrigStmt *b)
2377
- {
2378
- COMPARE_STRING_FIELD(trigname);
2379
- COMPARE_SCALAR_FIELD(tgenabled);
2380
-
2381
- return true;
2382
- }
2383
-
2384
- static bool
2385
- _equalCreatePLangStmt(const CreatePLangStmt *a, const CreatePLangStmt *b)
2386
- {
2387
- COMPARE_SCALAR_FIELD(replace);
2388
- COMPARE_STRING_FIELD(plname);
2389
- COMPARE_NODE_FIELD(plhandler);
2390
- COMPARE_NODE_FIELD(plinline);
2391
- COMPARE_NODE_FIELD(plvalidator);
2392
- COMPARE_SCALAR_FIELD(pltrusted);
2393
-
2394
- return true;
2395
- }
2396
-
2397
- static bool
2398
- _equalCreateRoleStmt(const CreateRoleStmt *a, const CreateRoleStmt *b)
2399
- {
2400
- COMPARE_SCALAR_FIELD(stmt_type);
2401
- COMPARE_STRING_FIELD(role);
2402
- COMPARE_NODE_FIELD(options);
2403
-
2404
- return true;
2405
- }
2406
-
2407
- static bool
2408
- _equalAlterRoleStmt(const AlterRoleStmt *a, const AlterRoleStmt *b)
2409
- {
2410
- COMPARE_NODE_FIELD(role);
2411
- COMPARE_NODE_FIELD(options);
2412
- COMPARE_SCALAR_FIELD(action);
2413
-
2414
- return true;
2415
- }
2416
-
2417
- static bool
2418
- _equalAlterRoleSetStmt(const AlterRoleSetStmt *a, const AlterRoleSetStmt *b)
2419
- {
2420
- COMPARE_NODE_FIELD(role);
2421
- COMPARE_STRING_FIELD(database);
2422
- COMPARE_NODE_FIELD(setstmt);
2423
-
2424
- return true;
2425
- }
2426
-
2427
- static bool
2428
- _equalDropRoleStmt(const DropRoleStmt *a, const DropRoleStmt *b)
2429
- {
2430
- COMPARE_NODE_FIELD(roles);
2431
- COMPARE_SCALAR_FIELD(missing_ok);
2432
-
2433
- return true;
2434
- }
2435
-
2436
- static bool
2437
- _equalLockStmt(const LockStmt *a, const LockStmt *b)
2438
- {
2439
- COMPARE_NODE_FIELD(relations);
2440
- COMPARE_SCALAR_FIELD(mode);
2441
- COMPARE_SCALAR_FIELD(nowait);
2442
-
2443
- return true;
2444
- }
2445
-
2446
- static bool
2447
- _equalConstraintsSetStmt(const ConstraintsSetStmt *a, const ConstraintsSetStmt *b)
2448
- {
2449
- COMPARE_NODE_FIELD(constraints);
2450
- COMPARE_SCALAR_FIELD(deferred);
2451
-
2452
- return true;
2453
- }
2454
-
2455
- static bool
2456
- _equalReindexStmt(const ReindexStmt *a, const ReindexStmt *b)
2457
- {
2458
- COMPARE_SCALAR_FIELD(kind);
2459
- COMPARE_NODE_FIELD(relation);
2460
- COMPARE_STRING_FIELD(name);
2461
- COMPARE_NODE_FIELD(params);
2462
-
2463
- return true;
2464
- }
2465
-
2466
- static bool
2467
- _equalCreateSchemaStmt(const CreateSchemaStmt *a, const CreateSchemaStmt *b)
2468
- {
2469
- COMPARE_STRING_FIELD(schemaname);
2470
- COMPARE_NODE_FIELD(authrole);
2471
- COMPARE_NODE_FIELD(schemaElts);
2472
- COMPARE_SCALAR_FIELD(if_not_exists);
2473
-
2474
- return true;
2475
- }
2476
-
2477
- static bool
2478
- _equalCreateConversionStmt(const CreateConversionStmt *a, const CreateConversionStmt *b)
2479
- {
2480
- COMPARE_NODE_FIELD(conversion_name);
2481
- COMPARE_STRING_FIELD(for_encoding_name);
2482
- COMPARE_STRING_FIELD(to_encoding_name);
2483
- COMPARE_NODE_FIELD(func_name);
2484
- COMPARE_SCALAR_FIELD(def);
2485
-
2486
- return true;
2487
- }
2488
-
2489
- static bool
2490
- _equalCreateCastStmt(const CreateCastStmt *a, const CreateCastStmt *b)
2491
- {
2492
- COMPARE_NODE_FIELD(sourcetype);
2493
- COMPARE_NODE_FIELD(targettype);
2494
- COMPARE_NODE_FIELD(func);
2495
- COMPARE_SCALAR_FIELD(context);
2496
- COMPARE_SCALAR_FIELD(inout);
2497
-
2498
- return true;
2499
- }
2500
-
2501
- static bool
2502
- _equalPrepareStmt(const PrepareStmt *a, const PrepareStmt *b)
2503
- {
2504
- COMPARE_STRING_FIELD(name);
2505
- COMPARE_NODE_FIELD(argtypes);
2506
- COMPARE_NODE_FIELD(query);
2507
-
2508
- return true;
2509
- }
2510
-
2511
- static bool
2512
- _equalExecuteStmt(const ExecuteStmt *a, const ExecuteStmt *b)
2513
- {
2514
- COMPARE_STRING_FIELD(name);
2515
- COMPARE_NODE_FIELD(params);
2516
-
2517
- return true;
2518
- }
2519
-
2520
- static bool
2521
- _equalDeallocateStmt(const DeallocateStmt *a, const DeallocateStmt *b)
2522
- {
2523
- COMPARE_STRING_FIELD(name);
2524
-
2525
- return true;
2526
- }
2527
-
2528
- static bool
2529
- _equalDropOwnedStmt(const DropOwnedStmt *a, const DropOwnedStmt *b)
2530
- {
2531
- COMPARE_NODE_FIELD(roles);
2532
- COMPARE_SCALAR_FIELD(behavior);
2533
-
2534
- return true;
2535
- }
2536
-
2537
- static bool
2538
- _equalReassignOwnedStmt(const ReassignOwnedStmt *a, const ReassignOwnedStmt *b)
2539
- {
2540
- COMPARE_NODE_FIELD(roles);
2541
- COMPARE_NODE_FIELD(newrole);
2542
-
2543
- return true;
2544
- }
2545
-
2546
- static bool
2547
- _equalAlterTSDictionaryStmt(const AlterTSDictionaryStmt *a, const AlterTSDictionaryStmt *b)
2548
- {
2549
- COMPARE_NODE_FIELD(dictname);
2550
- COMPARE_NODE_FIELD(options);
2551
-
2552
- return true;
2553
- }
2554
-
2555
- static bool
2556
- _equalAlterTSConfigurationStmt(const AlterTSConfigurationStmt *a,
2557
- const AlterTSConfigurationStmt *b)
2558
- {
2559
- COMPARE_SCALAR_FIELD(kind);
2560
- COMPARE_NODE_FIELD(cfgname);
2561
- COMPARE_NODE_FIELD(tokentype);
2562
- COMPARE_NODE_FIELD(dicts);
2563
- COMPARE_SCALAR_FIELD(override);
2564
- COMPARE_SCALAR_FIELD(replace);
2565
- COMPARE_SCALAR_FIELD(missing_ok);
2566
-
2567
- return true;
2568
- }
2569
-
2570
- static bool
2571
- _equalPublicationObject(const PublicationObjSpec *a,
2572
- const PublicationObjSpec *b)
2573
- {
2574
- COMPARE_SCALAR_FIELD(pubobjtype);
2575
- COMPARE_STRING_FIELD(name);
2576
- COMPARE_NODE_FIELD(pubtable);
2577
- COMPARE_LOCATION_FIELD(location);
2578
-
2579
- return true;
2580
- }
2581
-
2582
- static bool
2583
- _equalPublicationTable(const PublicationTable *a, const PublicationTable *b)
2584
- {
2585
- COMPARE_NODE_FIELD(relation);
2586
- COMPARE_NODE_FIELD(whereClause);
2587
- COMPARE_NODE_FIELD(columns);
2588
-
2589
- return true;
2590
- }
2591
-
2592
- static bool
2593
- _equalCreatePublicationStmt(const CreatePublicationStmt *a,
2594
- const CreatePublicationStmt *b)
2595
- {
2596
- COMPARE_STRING_FIELD(pubname);
2597
- COMPARE_NODE_FIELD(options);
2598
- COMPARE_NODE_FIELD(pubobjects);
2599
- COMPARE_SCALAR_FIELD(for_all_tables);
2600
-
2601
- return true;
2602
- }
2603
-
2604
- static bool
2605
- _equalAlterPublicationStmt(const AlterPublicationStmt *a,
2606
- const AlterPublicationStmt *b)
2607
- {
2608
- COMPARE_STRING_FIELD(pubname);
2609
- COMPARE_NODE_FIELD(options);
2610
- COMPARE_NODE_FIELD(pubobjects);
2611
- COMPARE_SCALAR_FIELD(for_all_tables);
2612
- COMPARE_SCALAR_FIELD(action);
2613
-
2614
- return true;
2615
- }
2616
-
2617
- static bool
2618
- _equalCreateSubscriptionStmt(const CreateSubscriptionStmt *a,
2619
- const CreateSubscriptionStmt *b)
2620
- {
2621
- COMPARE_STRING_FIELD(subname);
2622
- COMPARE_STRING_FIELD(conninfo);
2623
- COMPARE_NODE_FIELD(publication);
2624
- COMPARE_NODE_FIELD(options);
2625
-
2626
- return true;
2627
- }
2628
-
2629
- static bool
2630
- _equalAlterSubscriptionStmt(const AlterSubscriptionStmt *a,
2631
- const AlterSubscriptionStmt *b)
2632
- {
2633
- COMPARE_SCALAR_FIELD(kind);
2634
- COMPARE_STRING_FIELD(subname);
2635
- COMPARE_STRING_FIELD(conninfo);
2636
- COMPARE_NODE_FIELD(publication);
2637
- COMPARE_NODE_FIELD(options);
2638
-
2639
- return true;
2640
- }
2641
-
2642
- static bool
2643
- _equalDropSubscriptionStmt(const DropSubscriptionStmt *a,
2644
- const DropSubscriptionStmt *b)
2645
- {
2646
- COMPARE_STRING_FIELD(subname);
2647
- COMPARE_SCALAR_FIELD(missing_ok);
2648
- COMPARE_SCALAR_FIELD(behavior);
2649
-
2650
- return true;
2651
- }
2652
-
2653
- static bool
2654
- _equalCreatePolicyStmt(const CreatePolicyStmt *a, const CreatePolicyStmt *b)
2655
- {
2656
- COMPARE_STRING_FIELD(policy_name);
2657
- COMPARE_NODE_FIELD(table);
2658
- COMPARE_STRING_FIELD(cmd_name);
2659
- COMPARE_SCALAR_FIELD(permissive);
2660
- COMPARE_NODE_FIELD(roles);
2661
- COMPARE_NODE_FIELD(qual);
2662
- COMPARE_NODE_FIELD(with_check);
2663
-
2664
- return true;
2665
- }
2666
-
2667
- static bool
2668
- _equalAlterPolicyStmt(const AlterPolicyStmt *a, const AlterPolicyStmt *b)
2669
- {
2670
- COMPARE_STRING_FIELD(policy_name);
2671
- COMPARE_NODE_FIELD(table);
2672
- COMPARE_NODE_FIELD(roles);
2673
- COMPARE_NODE_FIELD(qual);
2674
- COMPARE_NODE_FIELD(with_check);
2675
-
2676
- return true;
2677
- }
2678
-
2679
- static bool
2680
- _equalA_Expr(const A_Expr *a, const A_Expr *b)
2681
- {
2682
- COMPARE_SCALAR_FIELD(kind);
2683
- COMPARE_NODE_FIELD(name);
2684
- COMPARE_NODE_FIELD(lexpr);
2685
- COMPARE_NODE_FIELD(rexpr);
2686
- COMPARE_LOCATION_FIELD(location);
2687
-
2688
- return true;
2689
- }
2690
-
2691
- static bool
2692
- _equalColumnRef(const ColumnRef *a, const ColumnRef *b)
2693
- {
2694
- COMPARE_NODE_FIELD(fields);
2695
- COMPARE_LOCATION_FIELD(location);
2696
-
2697
- return true;
2698
- }
2699
-
2700
- static bool
2701
- _equalParamRef(const ParamRef *a, const ParamRef *b)
2702
- {
2703
- COMPARE_SCALAR_FIELD(number);
2704
- COMPARE_LOCATION_FIELD(location);
2705
-
2706
- return true;
2707
- }
2708
-
2709
- static bool
2710
- _equalA_Const(const A_Const *a, const A_Const *b)
2711
- {
2712
- /*
2713
- * Hack for in-line val field. Also val is not valid is isnull is true.
2714
- */
2715
- if (!a->isnull && !b->isnull &&
2716
- !equal(&a->val, &b->val))
2717
- return false;
2718
- COMPARE_SCALAR_FIELD(isnull);
2719
- COMPARE_LOCATION_FIELD(location);
2720
-
2721
- return true;
2722
- }
2723
-
2724
- static bool
2725
- _equalFuncCall(const FuncCall *a, const FuncCall *b)
2726
- {
2727
- COMPARE_NODE_FIELD(funcname);
2728
- COMPARE_NODE_FIELD(args);
2729
- COMPARE_NODE_FIELD(agg_order);
2730
- COMPARE_NODE_FIELD(agg_filter);
2731
- COMPARE_NODE_FIELD(over);
2732
- COMPARE_SCALAR_FIELD(agg_within_group);
2733
- COMPARE_SCALAR_FIELD(agg_star);
2734
- COMPARE_SCALAR_FIELD(agg_distinct);
2735
- COMPARE_SCALAR_FIELD(func_variadic);
2736
- COMPARE_COERCIONFORM_FIELD(funcformat);
2737
- COMPARE_LOCATION_FIELD(location);
2738
-
2739
- return true;
2740
- }
2741
-
2742
- static bool
2743
- _equalA_Star(const A_Star *a, const A_Star *b)
2744
- {
2745
- return true;
2746
- }
2747
-
2748
- static bool
2749
- _equalA_Indices(const A_Indices *a, const A_Indices *b)
2750
- {
2751
- COMPARE_SCALAR_FIELD(is_slice);
2752
- COMPARE_NODE_FIELD(lidx);
2753
- COMPARE_NODE_FIELD(uidx);
2754
-
2755
- return true;
2756
- }
2757
-
2758
- static bool
2759
- _equalA_Indirection(const A_Indirection *a, const A_Indirection *b)
2760
- {
2761
- COMPARE_NODE_FIELD(arg);
2762
- COMPARE_NODE_FIELD(indirection);
2763
-
2764
- return true;
2765
- }
2766
-
2767
- static bool
2768
- _equalA_ArrayExpr(const A_ArrayExpr *a, const A_ArrayExpr *b)
2769
- {
2770
- COMPARE_NODE_FIELD(elements);
2771
- COMPARE_LOCATION_FIELD(location);
2772
-
2773
- return true;
2774
- }
2775
-
2776
- static bool
2777
- _equalResTarget(const ResTarget *a, const ResTarget *b)
2778
- {
2779
- COMPARE_STRING_FIELD(name);
2780
- COMPARE_NODE_FIELD(indirection);
2781
- COMPARE_NODE_FIELD(val);
2782
- COMPARE_LOCATION_FIELD(location);
2783
-
2784
- return true;
2785
- }
2786
-
2787
- static bool
2788
- _equalMultiAssignRef(const MultiAssignRef *a, const MultiAssignRef *b)
2789
- {
2790
- COMPARE_NODE_FIELD(source);
2791
- COMPARE_SCALAR_FIELD(colno);
2792
- COMPARE_SCALAR_FIELD(ncolumns);
2793
-
2794
- return true;
2795
- }
2796
-
2797
- static bool
2798
- _equalTypeName(const TypeName *a, const TypeName *b)
2799
- {
2800
- COMPARE_NODE_FIELD(names);
2801
- COMPARE_SCALAR_FIELD(typeOid);
2802
- COMPARE_SCALAR_FIELD(setof);
2803
- COMPARE_SCALAR_FIELD(pct_type);
2804
- COMPARE_NODE_FIELD(typmods);
2805
- COMPARE_SCALAR_FIELD(typemod);
2806
- COMPARE_NODE_FIELD(arrayBounds);
2807
- COMPARE_LOCATION_FIELD(location);
2808
-
2809
- return true;
2810
- }
2811
-
2812
- static bool
2813
- _equalTypeCast(const TypeCast *a, const TypeCast *b)
2814
- {
2815
- COMPARE_NODE_FIELD(arg);
2816
- COMPARE_NODE_FIELD(typeName);
2817
- COMPARE_LOCATION_FIELD(location);
2818
-
2819
- return true;
2820
- }
2821
-
2822
- static bool
2823
- _equalCollateClause(const CollateClause *a, const CollateClause *b)
2824
- {
2825
- COMPARE_NODE_FIELD(arg);
2826
- COMPARE_NODE_FIELD(collname);
2827
- COMPARE_LOCATION_FIELD(location);
2828
-
2829
- return true;
2830
- }
2831
-
2832
- static bool
2833
- _equalSortBy(const SortBy *a, const SortBy *b)
2834
- {
2835
- COMPARE_NODE_FIELD(node);
2836
- COMPARE_SCALAR_FIELD(sortby_dir);
2837
- COMPARE_SCALAR_FIELD(sortby_nulls);
2838
- COMPARE_NODE_FIELD(useOp);
2839
- COMPARE_LOCATION_FIELD(location);
2840
-
2841
- return true;
2842
- }
2843
-
2844
- static bool
2845
- _equalWindowDef(const WindowDef *a, const WindowDef *b)
2846
- {
2847
- COMPARE_STRING_FIELD(name);
2848
- COMPARE_STRING_FIELD(refname);
2849
- COMPARE_NODE_FIELD(partitionClause);
2850
- COMPARE_NODE_FIELD(orderClause);
2851
- COMPARE_SCALAR_FIELD(frameOptions);
2852
- COMPARE_NODE_FIELD(startOffset);
2853
- COMPARE_NODE_FIELD(endOffset);
2854
- COMPARE_LOCATION_FIELD(location);
2855
-
2856
- return true;
2857
- }
2858
-
2859
- static bool
2860
- _equalRangeSubselect(const RangeSubselect *a, const RangeSubselect *b)
2861
- {
2862
- COMPARE_SCALAR_FIELD(lateral);
2863
- COMPARE_NODE_FIELD(subquery);
2864
- COMPARE_NODE_FIELD(alias);
2865
-
2866
- return true;
2867
- }
2868
-
2869
- static bool
2870
- _equalRangeFunction(const RangeFunction *a, const RangeFunction *b)
2871
- {
2872
- COMPARE_SCALAR_FIELD(lateral);
2873
- COMPARE_SCALAR_FIELD(ordinality);
2874
- COMPARE_SCALAR_FIELD(is_rowsfrom);
2875
- COMPARE_NODE_FIELD(functions);
2876
- COMPARE_NODE_FIELD(alias);
2877
- COMPARE_NODE_FIELD(coldeflist);
2878
-
2879
- return true;
2880
- }
2881
-
2882
- static bool
2883
- _equalRangeTableSample(const RangeTableSample *a, const RangeTableSample *b)
2884
- {
2885
- COMPARE_NODE_FIELD(relation);
2886
- COMPARE_NODE_FIELD(method);
2887
- COMPARE_NODE_FIELD(args);
2888
- COMPARE_NODE_FIELD(repeatable);
2889
- COMPARE_LOCATION_FIELD(location);
2890
-
2891
- return true;
2892
- }
2893
-
2894
- static bool
2895
- _equalRangeTableFunc(const RangeTableFunc *a, const RangeTableFunc *b)
2896
- {
2897
- COMPARE_SCALAR_FIELD(lateral);
2898
- COMPARE_NODE_FIELD(docexpr);
2899
- COMPARE_NODE_FIELD(rowexpr);
2900
- COMPARE_NODE_FIELD(namespaces);
2901
- COMPARE_NODE_FIELD(columns);
2902
- COMPARE_NODE_FIELD(alias);
2903
- COMPARE_LOCATION_FIELD(location);
2904
-
2905
- return true;
2906
- }
2907
-
2908
- static bool
2909
- _equalRangeTableFuncCol(const RangeTableFuncCol *a, const RangeTableFuncCol *b)
2910
- {
2911
- COMPARE_STRING_FIELD(colname);
2912
- COMPARE_NODE_FIELD(typeName);
2913
- COMPARE_SCALAR_FIELD(for_ordinality);
2914
- COMPARE_SCALAR_FIELD(is_not_null);
2915
- COMPARE_NODE_FIELD(colexpr);
2916
- COMPARE_NODE_FIELD(coldefexpr);
2917
- COMPARE_LOCATION_FIELD(location);
2918
-
2919
- return true;
2920
- }
2921
-
2922
-
2923
- static bool
2924
- _equalIndexElem(const IndexElem *a, const IndexElem *b)
2925
- {
2926
- COMPARE_STRING_FIELD(name);
2927
- COMPARE_NODE_FIELD(expr);
2928
- COMPARE_STRING_FIELD(indexcolname);
2929
- COMPARE_NODE_FIELD(collation);
2930
- COMPARE_NODE_FIELD(opclass);
2931
- COMPARE_NODE_FIELD(opclassopts);
2932
- COMPARE_SCALAR_FIELD(ordering);
2933
- COMPARE_SCALAR_FIELD(nulls_ordering);
2934
-
2935
- return true;
2936
- }
2937
-
2938
-
2939
- static bool
2940
- _equalStatsElem(const StatsElem *a, const StatsElem *b)
2941
- {
2942
- COMPARE_STRING_FIELD(name);
2943
- COMPARE_NODE_FIELD(expr);
2944
-
2945
- return true;
2946
- }
2947
-
2948
- static bool
2949
- _equalColumnDef(const ColumnDef *a, const ColumnDef *b)
2950
- {
2951
- COMPARE_STRING_FIELD(colname);
2952
- COMPARE_NODE_FIELD(typeName);
2953
- COMPARE_STRING_FIELD(compression);
2954
- COMPARE_SCALAR_FIELD(inhcount);
2955
- COMPARE_SCALAR_FIELD(is_local);
2956
- COMPARE_SCALAR_FIELD(is_not_null);
2957
- COMPARE_SCALAR_FIELD(is_from_type);
2958
- COMPARE_SCALAR_FIELD(storage);
2959
- COMPARE_NODE_FIELD(raw_default);
2960
- COMPARE_NODE_FIELD(cooked_default);
2961
- COMPARE_SCALAR_FIELD(identity);
2962
- COMPARE_NODE_FIELD(identitySequence);
2963
- COMPARE_SCALAR_FIELD(generated);
2964
- COMPARE_NODE_FIELD(collClause);
2965
- COMPARE_SCALAR_FIELD(collOid);
2966
- COMPARE_NODE_FIELD(constraints);
2967
- COMPARE_NODE_FIELD(fdwoptions);
2968
- COMPARE_LOCATION_FIELD(location);
2969
-
2970
- return true;
2971
- }
2972
-
2973
- static bool
2974
- _equalConstraint(const Constraint *a, const Constraint *b)
2975
- {
2976
- COMPARE_SCALAR_FIELD(contype);
2977
- COMPARE_STRING_FIELD(conname);
2978
- COMPARE_SCALAR_FIELD(deferrable);
2979
- COMPARE_SCALAR_FIELD(initdeferred);
2980
- COMPARE_LOCATION_FIELD(location);
2981
- COMPARE_SCALAR_FIELD(is_no_inherit);
2982
- COMPARE_NODE_FIELD(raw_expr);
2983
- COMPARE_STRING_FIELD(cooked_expr);
2984
- COMPARE_SCALAR_FIELD(generated_when);
2985
- COMPARE_SCALAR_FIELD(nulls_not_distinct);
2986
- COMPARE_NODE_FIELD(keys);
2987
- COMPARE_NODE_FIELD(including);
2988
- COMPARE_NODE_FIELD(exclusions);
2989
- COMPARE_NODE_FIELD(options);
2990
- COMPARE_STRING_FIELD(indexname);
2991
- COMPARE_STRING_FIELD(indexspace);
2992
- COMPARE_SCALAR_FIELD(reset_default_tblspc);
2993
- COMPARE_STRING_FIELD(access_method);
2994
- COMPARE_NODE_FIELD(where_clause);
2995
- COMPARE_NODE_FIELD(pktable);
2996
- COMPARE_NODE_FIELD(fk_attrs);
2997
- COMPARE_NODE_FIELD(pk_attrs);
2998
- COMPARE_SCALAR_FIELD(fk_matchtype);
2999
- COMPARE_SCALAR_FIELD(fk_upd_action);
3000
- COMPARE_SCALAR_FIELD(fk_del_action);
3001
- COMPARE_NODE_FIELD(fk_del_set_cols);
3002
- COMPARE_NODE_FIELD(old_conpfeqop);
3003
- COMPARE_SCALAR_FIELD(old_pktable_oid);
3004
- COMPARE_SCALAR_FIELD(skip_validation);
3005
- COMPARE_SCALAR_FIELD(initially_valid);
3006
-
3007
- return true;
3008
- }
3009
-
3010
- static bool
3011
- _equalDefElem(const DefElem *a, const DefElem *b)
3012
- {
3013
- COMPARE_STRING_FIELD(defnamespace);
3014
- COMPARE_STRING_FIELD(defname);
3015
- COMPARE_NODE_FIELD(arg);
3016
- COMPARE_SCALAR_FIELD(defaction);
3017
- COMPARE_LOCATION_FIELD(location);
3018
-
3019
- return true;
3020
- }
3021
-
3022
- static bool
3023
- _equalLockingClause(const LockingClause *a, const LockingClause *b)
3024
- {
3025
- COMPARE_NODE_FIELD(lockedRels);
3026
- COMPARE_SCALAR_FIELD(strength);
3027
- COMPARE_SCALAR_FIELD(waitPolicy);
3028
-
3029
- return true;
3030
- }
3031
-
3032
- static bool
3033
- _equalRangeTblEntry(const RangeTblEntry *a, const RangeTblEntry *b)
3034
- {
3035
- COMPARE_SCALAR_FIELD(rtekind);
3036
- COMPARE_SCALAR_FIELD(relid);
3037
- COMPARE_SCALAR_FIELD(relkind);
3038
- COMPARE_SCALAR_FIELD(rellockmode);
3039
- COMPARE_NODE_FIELD(tablesample);
3040
- COMPARE_NODE_FIELD(subquery);
3041
- COMPARE_SCALAR_FIELD(security_barrier);
3042
- COMPARE_SCALAR_FIELD(jointype);
3043
- COMPARE_SCALAR_FIELD(joinmergedcols);
3044
- COMPARE_NODE_FIELD(joinaliasvars);
3045
- COMPARE_NODE_FIELD(joinleftcols);
3046
- COMPARE_NODE_FIELD(joinrightcols);
3047
- COMPARE_NODE_FIELD(join_using_alias);
3048
- COMPARE_NODE_FIELD(functions);
3049
- COMPARE_SCALAR_FIELD(funcordinality);
3050
- COMPARE_NODE_FIELD(tablefunc);
3051
- COMPARE_NODE_FIELD(values_lists);
3052
- COMPARE_STRING_FIELD(ctename);
3053
- COMPARE_SCALAR_FIELD(ctelevelsup);
3054
- COMPARE_SCALAR_FIELD(self_reference);
3055
- COMPARE_NODE_FIELD(coltypes);
3056
- COMPARE_NODE_FIELD(coltypmods);
3057
- COMPARE_NODE_FIELD(colcollations);
3058
- COMPARE_STRING_FIELD(enrname);
3059
- COMPARE_SCALAR_FIELD(enrtuples);
3060
- COMPARE_NODE_FIELD(alias);
3061
- COMPARE_NODE_FIELD(eref);
3062
- COMPARE_SCALAR_FIELD(lateral);
3063
- COMPARE_SCALAR_FIELD(inh);
3064
- COMPARE_SCALAR_FIELD(inFromCl);
3065
- COMPARE_SCALAR_FIELD(requiredPerms);
3066
- COMPARE_SCALAR_FIELD(checkAsUser);
3067
- COMPARE_BITMAPSET_FIELD(selectedCols);
3068
- COMPARE_BITMAPSET_FIELD(insertedCols);
3069
- COMPARE_BITMAPSET_FIELD(updatedCols);
3070
- COMPARE_BITMAPSET_FIELD(extraUpdatedCols);
3071
- COMPARE_NODE_FIELD(securityQuals);
3072
-
3073
- return true;
3074
- }
3075
-
3076
- static bool
3077
- _equalRangeTblFunction(const RangeTblFunction *a, const RangeTblFunction *b)
3078
- {
3079
- COMPARE_NODE_FIELD(funcexpr);
3080
- COMPARE_SCALAR_FIELD(funccolcount);
3081
- COMPARE_NODE_FIELD(funccolnames);
3082
- COMPARE_NODE_FIELD(funccoltypes);
3083
- COMPARE_NODE_FIELD(funccoltypmods);
3084
- COMPARE_NODE_FIELD(funccolcollations);
3085
- COMPARE_BITMAPSET_FIELD(funcparams);
3086
-
3087
- return true;
3088
- }
3089
-
3090
- static bool
3091
- _equalTableSampleClause(const TableSampleClause *a, const TableSampleClause *b)
3092
- {
3093
- COMPARE_SCALAR_FIELD(tsmhandler);
3094
- COMPARE_NODE_FIELD(args);
3095
- COMPARE_NODE_FIELD(repeatable);
3096
-
3097
- return true;
3098
- }
3099
-
3100
- static bool
3101
- _equalWithCheckOption(const WithCheckOption *a, const WithCheckOption *b)
3102
- {
3103
- COMPARE_SCALAR_FIELD(kind);
3104
- COMPARE_STRING_FIELD(relname);
3105
- COMPARE_STRING_FIELD(polname);
3106
- COMPARE_NODE_FIELD(qual);
3107
- COMPARE_SCALAR_FIELD(cascaded);
3108
-
3109
- return true;
3110
- }
3111
-
3112
- static bool
3113
- _equalSortGroupClause(const SortGroupClause *a, const SortGroupClause *b)
3114
- {
3115
- COMPARE_SCALAR_FIELD(tleSortGroupRef);
3116
- COMPARE_SCALAR_FIELD(eqop);
3117
- COMPARE_SCALAR_FIELD(sortop);
3118
- COMPARE_SCALAR_FIELD(nulls_first);
3119
- COMPARE_SCALAR_FIELD(hashable);
3120
-
3121
- return true;
3122
- }
3123
-
3124
- static bool
3125
- _equalGroupingSet(const GroupingSet *a, const GroupingSet *b)
3126
- {
3127
- COMPARE_SCALAR_FIELD(kind);
3128
- COMPARE_NODE_FIELD(content);
3129
- COMPARE_LOCATION_FIELD(location);
3130
-
3131
- return true;
3132
- }
3133
-
3134
- static bool
3135
- _equalWindowClause(const WindowClause *a, const WindowClause *b)
3136
- {
3137
- COMPARE_STRING_FIELD(name);
3138
- COMPARE_STRING_FIELD(refname);
3139
- COMPARE_NODE_FIELD(partitionClause);
3140
- COMPARE_NODE_FIELD(orderClause);
3141
- COMPARE_SCALAR_FIELD(frameOptions);
3142
- COMPARE_NODE_FIELD(startOffset);
3143
- COMPARE_NODE_FIELD(endOffset);
3144
- COMPARE_NODE_FIELD(runCondition);
3145
- COMPARE_SCALAR_FIELD(startInRangeFunc);
3146
- COMPARE_SCALAR_FIELD(endInRangeFunc);
3147
- COMPARE_SCALAR_FIELD(inRangeColl);
3148
- COMPARE_SCALAR_FIELD(inRangeAsc);
3149
- COMPARE_SCALAR_FIELD(inRangeNullsFirst);
3150
- COMPARE_SCALAR_FIELD(winref);
3151
- COMPARE_SCALAR_FIELD(copiedOrder);
3152
-
3153
- return true;
3154
- }
3155
-
3156
- static bool
3157
- _equalRowMarkClause(const RowMarkClause *a, const RowMarkClause *b)
3158
- {
3159
- COMPARE_SCALAR_FIELD(rti);
3160
- COMPARE_SCALAR_FIELD(strength);
3161
- COMPARE_SCALAR_FIELD(waitPolicy);
3162
- COMPARE_SCALAR_FIELD(pushedDown);
3163
-
3164
- return true;
3165
- }
3166
-
3167
- static bool
3168
- _equalWithClause(const WithClause *a, const WithClause *b)
3169
- {
3170
- COMPARE_NODE_FIELD(ctes);
3171
- COMPARE_SCALAR_FIELD(recursive);
3172
- COMPARE_LOCATION_FIELD(location);
3173
-
3174
- return true;
3175
- }
3176
-
3177
- static bool
3178
- _equalInferClause(const InferClause *a, const InferClause *b)
3179
- {
3180
- COMPARE_NODE_FIELD(indexElems);
3181
- COMPARE_NODE_FIELD(whereClause);
3182
- COMPARE_STRING_FIELD(conname);
3183
- COMPARE_LOCATION_FIELD(location);
3184
-
3185
- return true;
3186
- }
3187
-
3188
- static bool
3189
- _equalOnConflictClause(const OnConflictClause *a, const OnConflictClause *b)
3190
- {
3191
- COMPARE_SCALAR_FIELD(action);
3192
- COMPARE_NODE_FIELD(infer);
3193
- COMPARE_NODE_FIELD(targetList);
3194
- COMPARE_NODE_FIELD(whereClause);
3195
- COMPARE_LOCATION_FIELD(location);
3196
-
3197
- return true;
3198
- }
3199
-
3200
- static bool
3201
- _equalCTESearchClause(const CTESearchClause *a, const CTESearchClause *b)
3202
- {
3203
- COMPARE_NODE_FIELD(search_col_list);
3204
- COMPARE_SCALAR_FIELD(search_breadth_first);
3205
- COMPARE_STRING_FIELD(search_seq_column);
3206
- COMPARE_LOCATION_FIELD(location);
3207
-
3208
- return true;
3209
- }
3210
-
3211
- static bool
3212
- _equalCTECycleClause(const CTECycleClause *a, const CTECycleClause *b)
3213
- {
3214
- COMPARE_NODE_FIELD(cycle_col_list);
3215
- COMPARE_STRING_FIELD(cycle_mark_column);
3216
- COMPARE_NODE_FIELD(cycle_mark_value);
3217
- COMPARE_NODE_FIELD(cycle_mark_default);
3218
- COMPARE_STRING_FIELD(cycle_path_column);
3219
- COMPARE_LOCATION_FIELD(location);
3220
- COMPARE_SCALAR_FIELD(cycle_mark_type);
3221
- COMPARE_SCALAR_FIELD(cycle_mark_typmod);
3222
- COMPARE_SCALAR_FIELD(cycle_mark_collation);
3223
- COMPARE_SCALAR_FIELD(cycle_mark_neop);
3224
-
3225
- return true;
3226
- }
3227
-
3228
- static bool
3229
- _equalCommonTableExpr(const CommonTableExpr *a, const CommonTableExpr *b)
3230
- {
3231
- COMPARE_STRING_FIELD(ctename);
3232
- COMPARE_NODE_FIELD(aliascolnames);
3233
- COMPARE_SCALAR_FIELD(ctematerialized);
3234
- COMPARE_NODE_FIELD(ctequery);
3235
- COMPARE_NODE_FIELD(search_clause);
3236
- COMPARE_NODE_FIELD(cycle_clause);
3237
- COMPARE_LOCATION_FIELD(location);
3238
- COMPARE_SCALAR_FIELD(cterecursive);
3239
- COMPARE_SCALAR_FIELD(cterefcount);
3240
- COMPARE_NODE_FIELD(ctecolnames);
3241
- COMPARE_NODE_FIELD(ctecoltypes);
3242
- COMPARE_NODE_FIELD(ctecoltypmods);
3243
- COMPARE_NODE_FIELD(ctecolcollations);
3244
-
3245
- return true;
3246
- }
3247
-
3248
- static bool
3249
- _equalMergeWhenClause(const MergeWhenClause *a, const MergeWhenClause *b)
3250
- {
3251
- COMPARE_SCALAR_FIELD(matched);
3252
- COMPARE_SCALAR_FIELD(commandType);
3253
- COMPARE_SCALAR_FIELD(override);
3254
- COMPARE_NODE_FIELD(condition);
3255
- COMPARE_NODE_FIELD(targetList);
3256
- COMPARE_NODE_FIELD(values);
3257
-
3258
- return true;
3259
- }
3260
-
3261
- static bool
3262
- _equalMergeAction(const MergeAction *a, const MergeAction *b)
3263
- {
3264
- COMPARE_SCALAR_FIELD(matched);
3265
- COMPARE_SCALAR_FIELD(commandType);
3266
- COMPARE_SCALAR_FIELD(override);
3267
- COMPARE_NODE_FIELD(qual);
3268
- COMPARE_NODE_FIELD(targetList);
3269
- COMPARE_NODE_FIELD(updateColnos);
3270
-
3271
- return true;
3272
- }
3273
-
3274
- static bool
3275
- _equalXmlSerialize(const XmlSerialize *a, const XmlSerialize *b)
3276
- {
3277
- COMPARE_SCALAR_FIELD(xmloption);
3278
- COMPARE_NODE_FIELD(expr);
3279
- COMPARE_NODE_FIELD(typeName);
3280
- COMPARE_LOCATION_FIELD(location);
3281
-
3282
- return true;
3283
- }
3284
-
3285
- static bool
3286
- _equalRoleSpec(const RoleSpec *a, const RoleSpec *b)
3287
- {
3288
- COMPARE_SCALAR_FIELD(roletype);
3289
- COMPARE_STRING_FIELD(rolename);
3290
- COMPARE_LOCATION_FIELD(location);
3291
-
3292
- return true;
3293
- }
3294
-
3295
- static bool
3296
- _equalTriggerTransition(const TriggerTransition *a, const TriggerTransition *b)
3297
- {
3298
- COMPARE_STRING_FIELD(name);
3299
- COMPARE_SCALAR_FIELD(isNew);
3300
- COMPARE_SCALAR_FIELD(isTable);
3301
-
3302
- return true;
3303
- }
3304
-
3305
- static bool
3306
- _equalPartitionElem(const PartitionElem *a, const PartitionElem *b)
3307
- {
3308
- COMPARE_STRING_FIELD(name);
3309
- COMPARE_NODE_FIELD(expr);
3310
- COMPARE_NODE_FIELD(collation);
3311
- COMPARE_NODE_FIELD(opclass);
3312
- COMPARE_LOCATION_FIELD(location);
3313
-
3314
- return true;
3315
- }
3316
-
3317
- static bool
3318
- _equalPartitionSpec(const PartitionSpec *a, const PartitionSpec *b)
3319
- {
3320
- COMPARE_STRING_FIELD(strategy);
3321
- COMPARE_NODE_FIELD(partParams);
3322
- COMPARE_LOCATION_FIELD(location);
3323
-
3324
- return true;
3325
- }
3326
-
3327
- static bool
3328
- _equalPartitionBoundSpec(const PartitionBoundSpec *a, const PartitionBoundSpec *b)
3329
- {
3330
- COMPARE_SCALAR_FIELD(strategy);
3331
- COMPARE_SCALAR_FIELD(is_default);
3332
- COMPARE_SCALAR_FIELD(modulus);
3333
- COMPARE_SCALAR_FIELD(remainder);
3334
- COMPARE_NODE_FIELD(listdatums);
3335
- COMPARE_NODE_FIELD(lowerdatums);
3336
- COMPARE_NODE_FIELD(upperdatums);
3337
- COMPARE_LOCATION_FIELD(location);
3338
-
3339
- return true;
3340
- }
3341
-
3342
- static bool
3343
- _equalPartitionRangeDatum(const PartitionRangeDatum *a, const PartitionRangeDatum *b)
3344
- {
3345
- COMPARE_SCALAR_FIELD(kind);
3346
- COMPARE_NODE_FIELD(value);
3347
- COMPARE_LOCATION_FIELD(location);
3348
-
3349
- return true;
3350
- }
3351
-
3352
- static bool
3353
- _equalPartitionCmd(const PartitionCmd *a, const PartitionCmd *b)
3354
- {
3355
- COMPARE_NODE_FIELD(name);
3356
- COMPARE_NODE_FIELD(bound);
3357
- COMPARE_SCALAR_FIELD(concurrent);
3358
-
3359
- return true;
3360
- }
3361
-
3362
- /*
3363
- * Stuff from pg_list.h
3364
- */
3365
-
3366
- static bool
3367
- _equalList(const List *a, const List *b)
3368
- {
3369
- const ListCell *item_a;
3370
- const ListCell *item_b;
3371
-
3372
- /*
3373
- * Try to reject by simple scalar checks before grovelling through all the
3374
- * list elements...
3375
- */
3376
- COMPARE_SCALAR_FIELD(type);
3377
- COMPARE_SCALAR_FIELD(length);
3378
-
3379
- /*
3380
- * We place the switch outside the loop for the sake of efficiency; this
3381
- * may not be worth doing...
3382
- */
3383
- switch (a->type)
3384
- {
3385
- case T_List:
3386
- forboth(item_a, a, item_b, b)
3387
- {
3388
- if (!equal(lfirst(item_a), lfirst(item_b)))
3389
- return false;
3390
- }
3391
- break;
3392
- case T_IntList:
3393
- forboth(item_a, a, item_b, b)
3394
- {
3395
- if (lfirst_int(item_a) != lfirst_int(item_b))
3396
- return false;
3397
- }
3398
- break;
3399
- case T_OidList:
3400
- forboth(item_a, a, item_b, b)
3401
- {
3402
- if (lfirst_oid(item_a) != lfirst_oid(item_b))
3403
- return false;
3404
- }
3405
- break;
3406
- default:
3407
- elog(ERROR, "unrecognized list node type: %d",
3408
- (int) a->type);
3409
- return false; /* keep compiler quiet */
3410
- }
3411
-
3412
- /*
3413
- * If we got here, we should have run out of elements of both lists
3414
- */
3415
- Assert(item_a == NULL);
3416
- Assert(item_b == NULL);
3417
-
3418
- return true;
3419
- }
3420
-
3421
- /*
3422
- * Stuff from value.h
3423
- */
3424
-
3425
- static bool
3426
- _equalInteger(const Integer *a, const Integer *b)
3427
- {
3428
- COMPARE_SCALAR_FIELD(ival);
3429
-
3430
- return true;
3431
- }
3432
-
3433
- static bool
3434
- _equalFloat(const Float *a, const Float *b)
3435
- {
3436
- COMPARE_STRING_FIELD(fval);
3437
-
3438
- return true;
3439
- }
3440
-
3441
- static bool
3442
- _equalBoolean(const Boolean *a, const Boolean *b)
3443
- {
3444
- COMPARE_SCALAR_FIELD(boolval);
3445
-
3446
- return true;
3447
- }
3448
-
3449
- static bool
3450
- _equalString(const String *a, const String *b)
3451
- {
3452
- COMPARE_STRING_FIELD(sval);
3453
-
3454
- return true;
3455
- }
3456
-
3457
- static bool
3458
- _equalBitString(const BitString *a, const BitString *b)
3459
- {
3460
- COMPARE_STRING_FIELD(bsval);
3461
-
3462
- return true;
3463
- }
3464
-
3465
- /*
3466
- * equal
3467
- * returns whether two nodes are equal
3468
- */
3469
- bool
3470
- equal(const void *a, const void *b)
3471
- {
3472
- bool retval;
3473
-
3474
- if (a == b)
3475
- return true;
3476
-
3477
- /*
3478
- * note that a!=b, so only one of them can be NULL
3479
- */
3480
- if (a == NULL || b == NULL)
3481
- return false;
3482
-
3483
- /*
3484
- * are they the same type of nodes?
3485
- */
3486
- if (nodeTag(a) != nodeTag(b))
3487
- return false;
3488
-
3489
- /* Guard against stack overflow due to overly complex expressions */
3490
- check_stack_depth();
3491
-
3492
- switch (nodeTag(a))
3493
- {
3494
- /*
3495
- * PRIMITIVE NODES
3496
- */
3497
- case T_Alias:
3498
- retval = _equalAlias(a, b);
3499
- break;
3500
- case T_RangeVar:
3501
- retval = _equalRangeVar(a, b);
3502
- break;
3503
- case T_TableFunc:
3504
- retval = _equalTableFunc(a, b);
3505
- break;
3506
- case T_IntoClause:
3507
- retval = _equalIntoClause(a, b);
3508
- break;
3509
- case T_Var:
3510
- retval = _equalVar(a, b);
3511
- break;
3512
- case T_Const:
3513
- retval = _equalConst(a, b);
3514
- break;
3515
- case T_Param:
3516
- retval = _equalParam(a, b);
3517
- break;
3518
- case T_Aggref:
3519
- retval = _equalAggref(a, b);
3520
- break;
3521
- case T_GroupingFunc:
3522
- retval = _equalGroupingFunc(a, b);
3523
- break;
3524
- case T_WindowFunc:
3525
- retval = _equalWindowFunc(a, b);
3526
- break;
3527
- case T_SubscriptingRef:
3528
- retval = _equalSubscriptingRef(a, b);
3529
- break;
3530
- case T_FuncExpr:
3531
- retval = _equalFuncExpr(a, b);
3532
- break;
3533
- case T_NamedArgExpr:
3534
- retval = _equalNamedArgExpr(a, b);
3535
- break;
3536
- case T_OpExpr:
3537
- retval = _equalOpExpr(a, b);
3538
- break;
3539
- case T_DistinctExpr:
3540
- retval = _equalDistinctExpr(a, b);
3541
- break;
3542
- case T_NullIfExpr:
3543
- retval = _equalNullIfExpr(a, b);
3544
- break;
3545
- case T_ScalarArrayOpExpr:
3546
- retval = _equalScalarArrayOpExpr(a, b);
3547
- break;
3548
- case T_BoolExpr:
3549
- retval = _equalBoolExpr(a, b);
3550
- break;
3551
- case T_SubLink:
3552
- retval = _equalSubLink(a, b);
3553
- break;
3554
- case T_SubPlan:
3555
- retval = _equalSubPlan(a, b);
3556
- break;
3557
- case T_AlternativeSubPlan:
3558
- retval = _equalAlternativeSubPlan(a, b);
3559
- break;
3560
- case T_FieldSelect:
3561
- retval = _equalFieldSelect(a, b);
3562
- break;
3563
- case T_FieldStore:
3564
- retval = _equalFieldStore(a, b);
3565
- break;
3566
- case T_RelabelType:
3567
- retval = _equalRelabelType(a, b);
3568
- break;
3569
- case T_CoerceViaIO:
3570
- retval = _equalCoerceViaIO(a, b);
3571
- break;
3572
- case T_ArrayCoerceExpr:
3573
- retval = _equalArrayCoerceExpr(a, b);
3574
- break;
3575
- case T_ConvertRowtypeExpr:
3576
- retval = _equalConvertRowtypeExpr(a, b);
3577
- break;
3578
- case T_CollateExpr:
3579
- retval = _equalCollateExpr(a, b);
3580
- break;
3581
- case T_CaseExpr:
3582
- retval = _equalCaseExpr(a, b);
3583
- break;
3584
- case T_CaseWhen:
3585
- retval = _equalCaseWhen(a, b);
3586
- break;
3587
- case T_CaseTestExpr:
3588
- retval = _equalCaseTestExpr(a, b);
3589
- break;
3590
- case T_ArrayExpr:
3591
- retval = _equalArrayExpr(a, b);
3592
- break;
3593
- case T_RowExpr:
3594
- retval = _equalRowExpr(a, b);
3595
- break;
3596
- case T_RowCompareExpr:
3597
- retval = _equalRowCompareExpr(a, b);
3598
- break;
3599
- case T_CoalesceExpr:
3600
- retval = _equalCoalesceExpr(a, b);
3601
- break;
3602
- case T_MinMaxExpr:
3603
- retval = _equalMinMaxExpr(a, b);
3604
- break;
3605
- case T_SQLValueFunction:
3606
- retval = _equalSQLValueFunction(a, b);
3607
- break;
3608
- case T_XmlExpr:
3609
- retval = _equalXmlExpr(a, b);
3610
- break;
3611
- case T_NullTest:
3612
- retval = _equalNullTest(a, b);
3613
- break;
3614
- case T_BooleanTest:
3615
- retval = _equalBooleanTest(a, b);
3616
- break;
3617
- case T_CoerceToDomain:
3618
- retval = _equalCoerceToDomain(a, b);
3619
- break;
3620
- case T_CoerceToDomainValue:
3621
- retval = _equalCoerceToDomainValue(a, b);
3622
- break;
3623
- case T_SetToDefault:
3624
- retval = _equalSetToDefault(a, b);
3625
- break;
3626
- case T_CurrentOfExpr:
3627
- retval = _equalCurrentOfExpr(a, b);
3628
- break;
3629
- case T_NextValueExpr:
3630
- retval = _equalNextValueExpr(a, b);
3631
- break;
3632
- case T_InferenceElem:
3633
- retval = _equalInferenceElem(a, b);
3634
- break;
3635
- case T_TargetEntry:
3636
- retval = _equalTargetEntry(a, b);
3637
- break;
3638
- case T_RangeTblRef:
3639
- retval = _equalRangeTblRef(a, b);
3640
- break;
3641
- case T_FromExpr:
3642
- retval = _equalFromExpr(a, b);
3643
- break;
3644
- case T_OnConflictExpr:
3645
- retval = _equalOnConflictExpr(a, b);
3646
- break;
3647
- case T_JoinExpr:
3648
- retval = _equalJoinExpr(a, b);
3649
- break;
3650
-
3651
- /*
3652
- * RELATION NODES
3653
- */
3654
- case T_PathKey:
3655
- retval = _equalPathKey(a, b);
3656
- break;
3657
- case T_RestrictInfo:
3658
- retval = _equalRestrictInfo(a, b);
3659
- break;
3660
- case T_PlaceHolderVar:
3661
- retval = _equalPlaceHolderVar(a, b);
3662
- break;
3663
- case T_SpecialJoinInfo:
3664
- retval = _equalSpecialJoinInfo(a, b);
3665
- break;
3666
- case T_AppendRelInfo:
3667
- retval = _equalAppendRelInfo(a, b);
3668
- break;
3669
- case T_PlaceHolderInfo:
3670
- retval = _equalPlaceHolderInfo(a, b);
3671
- break;
256
+ switch (nodeTag(a))
257
+ {
258
+ #include "equalfuncs.switch.c"
3672
259
 
3673
260
  case T_List:
3674
261
  case T_IntList:
3675
262
  case T_OidList:
263
+ case T_XidList:
3676
264
  retval = _equalList(a, b);
3677
265
  break;
3678
266
 
3679
- case T_Integer:
3680
- retval = _equalInteger(a, b);
3681
- break;
3682
- case T_Float:
3683
- retval = _equalFloat(a, b);
3684
- break;
3685
- case T_Boolean:
3686
- retval = _equalBoolean(a, b);
3687
- break;
3688
- case T_String:
3689
- retval = _equalString(a, b);
3690
- break;
3691
- case T_BitString:
3692
- retval = _equalBitString(a, b);
3693
- break;
3694
-
3695
- /*
3696
- * EXTENSIBLE NODES
3697
- */
3698
- case T_ExtensibleNode:
3699
- retval = _equalExtensibleNode(a, b);
3700
- break;
3701
-
3702
- /*
3703
- * PARSE NODES
3704
- */
3705
- case T_Query:
3706
- retval = _equalQuery(a, b);
3707
- break;
3708
- case T_RawStmt:
3709
- retval = _equalRawStmt(a, b);
3710
- break;
3711
- case T_InsertStmt:
3712
- retval = _equalInsertStmt(a, b);
3713
- break;
3714
- case T_DeleteStmt:
3715
- retval = _equalDeleteStmt(a, b);
3716
- break;
3717
- case T_UpdateStmt:
3718
- retval = _equalUpdateStmt(a, b);
3719
- break;
3720
- case T_MergeStmt:
3721
- retval = _equalMergeStmt(a, b);
3722
- break;
3723
- case T_SelectStmt:
3724
- retval = _equalSelectStmt(a, b);
3725
- break;
3726
- case T_SetOperationStmt:
3727
- retval = _equalSetOperationStmt(a, b);
3728
- break;
3729
- case T_ReturnStmt:
3730
- retval = _equalReturnStmt(a, b);
3731
- break;
3732
- case T_PLAssignStmt:
3733
- retval = _equalPLAssignStmt(a, b);
3734
- break;
3735
- case T_AlterTableStmt:
3736
- retval = _equalAlterTableStmt(a, b);
3737
- break;
3738
- case T_AlterTableCmd:
3739
- retval = _equalAlterTableCmd(a, b);
3740
- break;
3741
- case T_AlterCollationStmt:
3742
- retval = _equalAlterCollationStmt(a, b);
3743
- break;
3744
- case T_AlterDomainStmt:
3745
- retval = _equalAlterDomainStmt(a, b);
3746
- break;
3747
- case T_GrantStmt:
3748
- retval = _equalGrantStmt(a, b);
3749
- break;
3750
- case T_GrantRoleStmt:
3751
- retval = _equalGrantRoleStmt(a, b);
3752
- break;
3753
- case T_AlterDefaultPrivilegesStmt:
3754
- retval = _equalAlterDefaultPrivilegesStmt(a, b);
3755
- break;
3756
- case T_DeclareCursorStmt:
3757
- retval = _equalDeclareCursorStmt(a, b);
3758
- break;
3759
- case T_ClosePortalStmt:
3760
- retval = _equalClosePortalStmt(a, b);
3761
- break;
3762
- case T_CallStmt:
3763
- retval = _equalCallStmt(a, b);
3764
- break;
3765
- case T_ClusterStmt:
3766
- retval = _equalClusterStmt(a, b);
3767
- break;
3768
- case T_CopyStmt:
3769
- retval = _equalCopyStmt(a, b);
3770
- break;
3771
- case T_CreateStmt:
3772
- retval = _equalCreateStmt(a, b);
3773
- break;
3774
- case T_TableLikeClause:
3775
- retval = _equalTableLikeClause(a, b);
3776
- break;
3777
- case T_DefineStmt:
3778
- retval = _equalDefineStmt(a, b);
3779
- break;
3780
- case T_DropStmt:
3781
- retval = _equalDropStmt(a, b);
3782
- break;
3783
- case T_TruncateStmt:
3784
- retval = _equalTruncateStmt(a, b);
3785
- break;
3786
- case T_CommentStmt:
3787
- retval = _equalCommentStmt(a, b);
3788
- break;
3789
- case T_SecLabelStmt:
3790
- retval = _equalSecLabelStmt(a, b);
3791
- break;
3792
- case T_FetchStmt:
3793
- retval = _equalFetchStmt(a, b);
3794
- break;
3795
- case T_IndexStmt:
3796
- retval = _equalIndexStmt(a, b);
3797
- break;
3798
- case T_CreateStatsStmt:
3799
- retval = _equalCreateStatsStmt(a, b);
3800
- break;
3801
- case T_AlterStatsStmt:
3802
- retval = _equalAlterStatsStmt(a, b);
3803
- break;
3804
- case T_CreateFunctionStmt:
3805
- retval = _equalCreateFunctionStmt(a, b);
3806
- break;
3807
- case T_FunctionParameter:
3808
- retval = _equalFunctionParameter(a, b);
3809
- break;
3810
- case T_AlterFunctionStmt:
3811
- retval = _equalAlterFunctionStmt(a, b);
3812
- break;
3813
- case T_DoStmt:
3814
- retval = _equalDoStmt(a, b);
3815
- break;
3816
- case T_RenameStmt:
3817
- retval = _equalRenameStmt(a, b);
3818
- break;
3819
- case T_AlterObjectDependsStmt:
3820
- retval = _equalAlterObjectDependsStmt(a, b);
3821
- break;
3822
- case T_AlterObjectSchemaStmt:
3823
- retval = _equalAlterObjectSchemaStmt(a, b);
3824
- break;
3825
- case T_AlterOwnerStmt:
3826
- retval = _equalAlterOwnerStmt(a, b);
3827
- break;
3828
- case T_AlterOperatorStmt:
3829
- retval = _equalAlterOperatorStmt(a, b);
3830
- break;
3831
- case T_AlterTypeStmt:
3832
- retval = _equalAlterTypeStmt(a, b);
3833
- break;
3834
- case T_RuleStmt:
3835
- retval = _equalRuleStmt(a, b);
3836
- break;
3837
- case T_NotifyStmt:
3838
- retval = _equalNotifyStmt(a, b);
3839
- break;
3840
- case T_ListenStmt:
3841
- retval = _equalListenStmt(a, b);
3842
- break;
3843
- case T_UnlistenStmt:
3844
- retval = _equalUnlistenStmt(a, b);
3845
- break;
3846
- case T_TransactionStmt:
3847
- retval = _equalTransactionStmt(a, b);
3848
- break;
3849
- case T_CompositeTypeStmt:
3850
- retval = _equalCompositeTypeStmt(a, b);
3851
- break;
3852
- case T_CreateEnumStmt:
3853
- retval = _equalCreateEnumStmt(a, b);
3854
- break;
3855
- case T_CreateRangeStmt:
3856
- retval = _equalCreateRangeStmt(a, b);
3857
- break;
3858
- case T_AlterEnumStmt:
3859
- retval = _equalAlterEnumStmt(a, b);
3860
- break;
3861
- case T_ViewStmt:
3862
- retval = _equalViewStmt(a, b);
3863
- break;
3864
- case T_LoadStmt:
3865
- retval = _equalLoadStmt(a, b);
3866
- break;
3867
- case T_CreateDomainStmt:
3868
- retval = _equalCreateDomainStmt(a, b);
3869
- break;
3870
- case T_CreateOpClassStmt:
3871
- retval = _equalCreateOpClassStmt(a, b);
3872
- break;
3873
- case T_CreateOpClassItem:
3874
- retval = _equalCreateOpClassItem(a, b);
3875
- break;
3876
- case T_CreateOpFamilyStmt:
3877
- retval = _equalCreateOpFamilyStmt(a, b);
3878
- break;
3879
- case T_AlterOpFamilyStmt:
3880
- retval = _equalAlterOpFamilyStmt(a, b);
3881
- break;
3882
- case T_CreatedbStmt:
3883
- retval = _equalCreatedbStmt(a, b);
3884
- break;
3885
- case T_AlterDatabaseStmt:
3886
- retval = _equalAlterDatabaseStmt(a, b);
3887
- break;
3888
- case T_AlterDatabaseRefreshCollStmt:
3889
- retval = _equalAlterDatabaseRefreshCollStmt(a, b);
3890
- break;
3891
- case T_AlterDatabaseSetStmt:
3892
- retval = _equalAlterDatabaseSetStmt(a, b);
3893
- break;
3894
- case T_DropdbStmt:
3895
- retval = _equalDropdbStmt(a, b);
3896
- break;
3897
- case T_VacuumStmt:
3898
- retval = _equalVacuumStmt(a, b);
3899
- break;
3900
- case T_VacuumRelation:
3901
- retval = _equalVacuumRelation(a, b);
3902
- break;
3903
- case T_ExplainStmt:
3904
- retval = _equalExplainStmt(a, b);
3905
- break;
3906
- case T_CreateTableAsStmt:
3907
- retval = _equalCreateTableAsStmt(a, b);
3908
- break;
3909
- case T_RefreshMatViewStmt:
3910
- retval = _equalRefreshMatViewStmt(a, b);
3911
- break;
3912
- case T_ReplicaIdentityStmt:
3913
- retval = _equalReplicaIdentityStmt(a, b);
3914
- break;
3915
- case T_AlterSystemStmt:
3916
- retval = _equalAlterSystemStmt(a, b);
3917
- break;
3918
- case T_CreateSeqStmt:
3919
- retval = _equalCreateSeqStmt(a, b);
3920
- break;
3921
- case T_AlterSeqStmt:
3922
- retval = _equalAlterSeqStmt(a, b);
3923
- break;
3924
- case T_VariableSetStmt:
3925
- retval = _equalVariableSetStmt(a, b);
3926
- break;
3927
- case T_VariableShowStmt:
3928
- retval = _equalVariableShowStmt(a, b);
3929
- break;
3930
- case T_DiscardStmt:
3931
- retval = _equalDiscardStmt(a, b);
3932
- break;
3933
- case T_CreateTableSpaceStmt:
3934
- retval = _equalCreateTableSpaceStmt(a, b);
3935
- break;
3936
- case T_DropTableSpaceStmt:
3937
- retval = _equalDropTableSpaceStmt(a, b);
3938
- break;
3939
- case T_AlterTableSpaceOptionsStmt:
3940
- retval = _equalAlterTableSpaceOptionsStmt(a, b);
3941
- break;
3942
- case T_AlterTableMoveAllStmt:
3943
- retval = _equalAlterTableMoveAllStmt(a, b);
3944
- break;
3945
- case T_CreateExtensionStmt:
3946
- retval = _equalCreateExtensionStmt(a, b);
3947
- break;
3948
- case T_AlterExtensionStmt:
3949
- retval = _equalAlterExtensionStmt(a, b);
3950
- break;
3951
- case T_AlterExtensionContentsStmt:
3952
- retval = _equalAlterExtensionContentsStmt(a, b);
3953
- break;
3954
- case T_CreateFdwStmt:
3955
- retval = _equalCreateFdwStmt(a, b);
3956
- break;
3957
- case T_AlterFdwStmt:
3958
- retval = _equalAlterFdwStmt(a, b);
3959
- break;
3960
- case T_CreateForeignServerStmt:
3961
- retval = _equalCreateForeignServerStmt(a, b);
3962
- break;
3963
- case T_AlterForeignServerStmt:
3964
- retval = _equalAlterForeignServerStmt(a, b);
3965
- break;
3966
- case T_CreateUserMappingStmt:
3967
- retval = _equalCreateUserMappingStmt(a, b);
3968
- break;
3969
- case T_AlterUserMappingStmt:
3970
- retval = _equalAlterUserMappingStmt(a, b);
3971
- break;
3972
- case T_DropUserMappingStmt:
3973
- retval = _equalDropUserMappingStmt(a, b);
3974
- break;
3975
- case T_CreateForeignTableStmt:
3976
- retval = _equalCreateForeignTableStmt(a, b);
3977
- break;
3978
- case T_ImportForeignSchemaStmt:
3979
- retval = _equalImportForeignSchemaStmt(a, b);
3980
- break;
3981
- case T_CreateTransformStmt:
3982
- retval = _equalCreateTransformStmt(a, b);
3983
- break;
3984
- case T_CreateAmStmt:
3985
- retval = _equalCreateAmStmt(a, b);
3986
- break;
3987
- case T_CreateTrigStmt:
3988
- retval = _equalCreateTrigStmt(a, b);
3989
- break;
3990
- case T_CreateEventTrigStmt:
3991
- retval = _equalCreateEventTrigStmt(a, b);
3992
- break;
3993
- case T_AlterEventTrigStmt:
3994
- retval = _equalAlterEventTrigStmt(a, b);
3995
- break;
3996
- case T_CreatePLangStmt:
3997
- retval = _equalCreatePLangStmt(a, b);
3998
- break;
3999
- case T_CreateRoleStmt:
4000
- retval = _equalCreateRoleStmt(a, b);
4001
- break;
4002
- case T_AlterRoleStmt:
4003
- retval = _equalAlterRoleStmt(a, b);
4004
- break;
4005
- case T_AlterRoleSetStmt:
4006
- retval = _equalAlterRoleSetStmt(a, b);
4007
- break;
4008
- case T_DropRoleStmt:
4009
- retval = _equalDropRoleStmt(a, b);
4010
- break;
4011
- case T_LockStmt:
4012
- retval = _equalLockStmt(a, b);
4013
- break;
4014
- case T_ConstraintsSetStmt:
4015
- retval = _equalConstraintsSetStmt(a, b);
4016
- break;
4017
- case T_ReindexStmt:
4018
- retval = _equalReindexStmt(a, b);
4019
- break;
4020
- case T_CheckPointStmt:
4021
- retval = true;
4022
- break;
4023
- case T_CreateSchemaStmt:
4024
- retval = _equalCreateSchemaStmt(a, b);
4025
- break;
4026
- case T_CreateConversionStmt:
4027
- retval = _equalCreateConversionStmt(a, b);
4028
- break;
4029
- case T_CreateCastStmt:
4030
- retval = _equalCreateCastStmt(a, b);
4031
- break;
4032
- case T_PrepareStmt:
4033
- retval = _equalPrepareStmt(a, b);
4034
- break;
4035
- case T_ExecuteStmt:
4036
- retval = _equalExecuteStmt(a, b);
4037
- break;
4038
- case T_DeallocateStmt:
4039
- retval = _equalDeallocateStmt(a, b);
4040
- break;
4041
- case T_DropOwnedStmt:
4042
- retval = _equalDropOwnedStmt(a, b);
4043
- break;
4044
- case T_ReassignOwnedStmt:
4045
- retval = _equalReassignOwnedStmt(a, b);
4046
- break;
4047
- case T_AlterTSDictionaryStmt:
4048
- retval = _equalAlterTSDictionaryStmt(a, b);
4049
- break;
4050
- case T_AlterTSConfigurationStmt:
4051
- retval = _equalAlterTSConfigurationStmt(a, b);
4052
- break;
4053
- case T_CreatePolicyStmt:
4054
- retval = _equalCreatePolicyStmt(a, b);
4055
- break;
4056
- case T_AlterPolicyStmt:
4057
- retval = _equalAlterPolicyStmt(a, b);
4058
- break;
4059
- case T_CreatePublicationStmt:
4060
- retval = _equalCreatePublicationStmt(a, b);
4061
- break;
4062
- case T_AlterPublicationStmt:
4063
- retval = _equalAlterPublicationStmt(a, b);
4064
- break;
4065
- case T_CreateSubscriptionStmt:
4066
- retval = _equalCreateSubscriptionStmt(a, b);
4067
- break;
4068
- case T_AlterSubscriptionStmt:
4069
- retval = _equalAlterSubscriptionStmt(a, b);
4070
- break;
4071
- case T_DropSubscriptionStmt:
4072
- retval = _equalDropSubscriptionStmt(a, b);
4073
- break;
4074
- case T_A_Expr:
4075
- retval = _equalA_Expr(a, b);
4076
- break;
4077
- case T_ColumnRef:
4078
- retval = _equalColumnRef(a, b);
4079
- break;
4080
- case T_ParamRef:
4081
- retval = _equalParamRef(a, b);
4082
- break;
4083
- case T_A_Const:
4084
- retval = _equalA_Const(a, b);
4085
- break;
4086
- case T_FuncCall:
4087
- retval = _equalFuncCall(a, b);
4088
- break;
4089
- case T_A_Star:
4090
- retval = _equalA_Star(a, b);
4091
- break;
4092
- case T_A_Indices:
4093
- retval = _equalA_Indices(a, b);
4094
- break;
4095
- case T_A_Indirection:
4096
- retval = _equalA_Indirection(a, b);
4097
- break;
4098
- case T_A_ArrayExpr:
4099
- retval = _equalA_ArrayExpr(a, b);
4100
- break;
4101
- case T_ResTarget:
4102
- retval = _equalResTarget(a, b);
4103
- break;
4104
- case T_MultiAssignRef:
4105
- retval = _equalMultiAssignRef(a, b);
4106
- break;
4107
- case T_TypeCast:
4108
- retval = _equalTypeCast(a, b);
4109
- break;
4110
- case T_CollateClause:
4111
- retval = _equalCollateClause(a, b);
4112
- break;
4113
- case T_SortBy:
4114
- retval = _equalSortBy(a, b);
4115
- break;
4116
- case T_WindowDef:
4117
- retval = _equalWindowDef(a, b);
4118
- break;
4119
- case T_RangeSubselect:
4120
- retval = _equalRangeSubselect(a, b);
4121
- break;
4122
- case T_RangeFunction:
4123
- retval = _equalRangeFunction(a, b);
4124
- break;
4125
- case T_RangeTableSample:
4126
- retval = _equalRangeTableSample(a, b);
4127
- break;
4128
- case T_RangeTableFunc:
4129
- retval = _equalRangeTableFunc(a, b);
4130
- break;
4131
- case T_RangeTableFuncCol:
4132
- retval = _equalRangeTableFuncCol(a, b);
4133
- break;
4134
- case T_TypeName:
4135
- retval = _equalTypeName(a, b);
4136
- break;
4137
- case T_IndexElem:
4138
- retval = _equalIndexElem(a, b);
4139
- break;
4140
- case T_StatsElem:
4141
- retval = _equalStatsElem(a, b);
4142
- break;
4143
- case T_ColumnDef:
4144
- retval = _equalColumnDef(a, b);
4145
- break;
4146
- case T_Constraint:
4147
- retval = _equalConstraint(a, b);
4148
- break;
4149
- case T_DefElem:
4150
- retval = _equalDefElem(a, b);
4151
- break;
4152
- case T_LockingClause:
4153
- retval = _equalLockingClause(a, b);
4154
- break;
4155
- case T_RangeTblEntry:
4156
- retval = _equalRangeTblEntry(a, b);
4157
- break;
4158
- case T_RangeTblFunction:
4159
- retval = _equalRangeTblFunction(a, b);
4160
- break;
4161
- case T_TableSampleClause:
4162
- retval = _equalTableSampleClause(a, b);
4163
- break;
4164
- case T_WithCheckOption:
4165
- retval = _equalWithCheckOption(a, b);
4166
- break;
4167
- case T_SortGroupClause:
4168
- retval = _equalSortGroupClause(a, b);
4169
- break;
4170
- case T_GroupingSet:
4171
- retval = _equalGroupingSet(a, b);
4172
- break;
4173
- case T_WindowClause:
4174
- retval = _equalWindowClause(a, b);
4175
- break;
4176
- case T_RowMarkClause:
4177
- retval = _equalRowMarkClause(a, b);
4178
- break;
4179
- case T_WithClause:
4180
- retval = _equalWithClause(a, b);
4181
- break;
4182
- case T_InferClause:
4183
- retval = _equalInferClause(a, b);
4184
- break;
4185
- case T_OnConflictClause:
4186
- retval = _equalOnConflictClause(a, b);
4187
- break;
4188
- case T_CTESearchClause:
4189
- retval = _equalCTESearchClause(a, b);
4190
- break;
4191
- case T_CTECycleClause:
4192
- retval = _equalCTECycleClause(a, b);
4193
- break;
4194
- case T_CommonTableExpr:
4195
- retval = _equalCommonTableExpr(a, b);
4196
- break;
4197
- case T_MergeWhenClause:
4198
- retval = _equalMergeWhenClause(a, b);
4199
- break;
4200
- case T_MergeAction:
4201
- retval = _equalMergeAction(a, b);
4202
- break;
4203
- case T_ObjectWithArgs:
4204
- retval = _equalObjectWithArgs(a, b);
4205
- break;
4206
- case T_AccessPriv:
4207
- retval = _equalAccessPriv(a, b);
4208
- break;
4209
- case T_XmlSerialize:
4210
- retval = _equalXmlSerialize(a, b);
4211
- break;
4212
- case T_RoleSpec:
4213
- retval = _equalRoleSpec(a, b);
4214
- break;
4215
- case T_TriggerTransition:
4216
- retval = _equalTriggerTransition(a, b);
4217
- break;
4218
- case T_PartitionElem:
4219
- retval = _equalPartitionElem(a, b);
4220
- break;
4221
- case T_PartitionSpec:
4222
- retval = _equalPartitionSpec(a, b);
4223
- break;
4224
- case T_PartitionBoundSpec:
4225
- retval = _equalPartitionBoundSpec(a, b);
4226
- break;
4227
- case T_PartitionRangeDatum:
4228
- retval = _equalPartitionRangeDatum(a, b);
4229
- break;
4230
- case T_PartitionCmd:
4231
- retval = _equalPartitionCmd(a, b);
4232
- break;
4233
- case T_PublicationObjSpec:
4234
- retval = _equalPublicationObject(a, b);
4235
- break;
4236
- case T_PublicationTable:
4237
- retval = _equalPublicationTable(a, b);
4238
- break;
4239
-
4240
267
  default:
4241
268
  elog(ERROR, "unrecognized node type: %d",
4242
269
  (int) nodeTag(a));