pg_query 4.2.1 → 6.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (901) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +61 -0
  3. data/README.md +7 -9
  4. data/Rakefile +5 -6
  5. data/ext/pg_query/ext_symbols_freebsd.sym +1 -0
  6. data/ext/pg_query/ext_symbols_freebsd_with_ruby_abi_version.sym +2 -0
  7. data/ext/pg_query/ext_symbols_openbsd.sym +1 -0
  8. data/ext/pg_query/ext_symbols_openbsd_with_ruby_abi_version.sym +2 -0
  9. data/ext/pg_query/ext_symbols_with_ruby_abi_version.sym +2 -0
  10. data/ext/pg_query/extconf.rb +33 -9
  11. data/ext/pg_query/include/pg_query.h +28 -3
  12. data/ext/pg_query/include/pg_query_enum_defs.c +599 -167
  13. data/ext/pg_query/include/pg_query_fingerprint_conds.c +640 -520
  14. data/ext/pg_query/include/pg_query_fingerprint_defs.c +6400 -4633
  15. data/ext/pg_query/include/pg_query_outfuncs_conds.c +433 -343
  16. data/ext/pg_query/include/pg_query_outfuncs_defs.c +1472 -1152
  17. data/ext/pg_query/include/pg_query_readfuncs_conds.c +154 -124
  18. data/ext/pg_query/include/pg_query_readfuncs_defs.c +1886 -1506
  19. data/ext/pg_query/include/postgres/access/amapi.h +303 -0
  20. data/ext/pg_query/include/postgres/access/attmap.h +54 -0
  21. data/ext/pg_query/include/postgres/access/attnum.h +64 -0
  22. data/ext/pg_query/include/postgres/access/brin_internal.h +116 -0
  23. data/ext/pg_query/include/postgres/access/brin_tuple.h +112 -0
  24. data/ext/pg_query/include/postgres/access/clog.h +62 -0
  25. data/ext/pg_query/include/postgres/access/commit_ts.h +73 -0
  26. data/ext/pg_query/include/postgres/access/detoast.h +82 -0
  27. data/ext/pg_query/include/postgres/access/genam.h +246 -0
  28. data/ext/pg_query/include/postgres/access/gin.h +91 -0
  29. data/ext/pg_query/include/postgres/access/htup.h +89 -0
  30. data/ext/pg_query/include/postgres/access/htup_details.h +811 -0
  31. data/ext/pg_query/include/postgres/access/itup.h +170 -0
  32. data/ext/pg_query/include/postgres/access/parallel.h +81 -0
  33. data/ext/pg_query/include/postgres/access/printtup.h +35 -0
  34. data/ext/pg_query/include/postgres/access/relation.h +28 -0
  35. data/ext/pg_query/include/postgres/access/relscan.h +191 -0
  36. data/ext/pg_query/include/postgres/access/rmgrlist.h +49 -0
  37. data/ext/pg_query/include/postgres/access/sdir.h +67 -0
  38. data/ext/pg_query/include/postgres/access/skey.h +151 -0
  39. data/ext/pg_query/include/postgres/access/slru.h +218 -0
  40. data/ext/pg_query/include/postgres/access/stratnum.h +85 -0
  41. data/ext/pg_query/include/postgres/access/sysattr.h +29 -0
  42. data/ext/pg_query/include/postgres/access/table.h +28 -0
  43. data/ext/pg_query/include/postgres/access/tableam.h +2110 -0
  44. data/ext/pg_query/include/postgres/access/tidstore.h +50 -0
  45. data/ext/pg_query/include/postgres/access/toast_compression.h +73 -0
  46. data/ext/pg_query/include/postgres/access/transam.h +418 -0
  47. data/ext/pg_query/include/postgres/access/tsmapi.h +82 -0
  48. data/ext/pg_query/include/postgres/access/tupconvert.h +54 -0
  49. data/ext/pg_query/include/postgres/access/tupdesc.h +154 -0
  50. data/ext/pg_query/include/postgres/access/tupmacs.h +207 -0
  51. data/ext/pg_query/include/postgres/access/twophase.h +65 -0
  52. data/ext/pg_query/include/postgres/access/xact.h +530 -0
  53. data/ext/pg_query/include/postgres/access/xlog.h +310 -0
  54. data/ext/pg_query/include/postgres/access/xlog_internal.h +405 -0
  55. data/ext/pg_query/include/postgres/access/xlogbackup.h +43 -0
  56. data/ext/pg_query/include/postgres/access/xlogdefs.h +82 -0
  57. data/ext/pg_query/include/postgres/access/xlogprefetcher.h +55 -0
  58. data/ext/pg_query/include/postgres/access/xlogreader.h +444 -0
  59. data/ext/pg_query/include/postgres/access/xlogrecord.h +248 -0
  60. data/ext/pg_query/include/postgres/access/xlogrecovery.h +158 -0
  61. data/ext/pg_query/include/postgres/archive/archive_module.h +67 -0
  62. data/ext/pg_query/include/postgres/c.h +1374 -0
  63. data/ext/pg_query/include/postgres/catalog/catalog.h +47 -0
  64. data/ext/pg_query/include/postgres/catalog/catversion.h +62 -0
  65. data/ext/pg_query/include/postgres/catalog/dependency.h +228 -0
  66. data/ext/pg_query/include/postgres/catalog/genbki.h +149 -0
  67. data/ext/pg_query/include/postgres/catalog/index.h +218 -0
  68. data/ext/pg_query/include/postgres/catalog/indexing.h +54 -0
  69. data/ext/pg_query/include/postgres/catalog/namespace.h +189 -0
  70. data/ext/pg_query/include/postgres/catalog/objectaccess.h +267 -0
  71. data/ext/pg_query/include/postgres/catalog/objectaddress.h +93 -0
  72. data/ext/pg_query/include/postgres/catalog/pg_aggregate.h +182 -0
  73. data/ext/pg_query/include/postgres/catalog/pg_aggregate_d.h +78 -0
  74. data/ext/pg_query/include/postgres/catalog/pg_am.h +66 -0
  75. data/ext/pg_query/include/postgres/catalog/pg_am_d.h +47 -0
  76. data/ext/pg_query/include/postgres/catalog/pg_attribute.h +240 -0
  77. data/ext/pg_query/include/postgres/catalog/pg_attribute_d.h +62 -0
  78. data/ext/pg_query/include/postgres/catalog/pg_authid.h +66 -0
  79. data/ext/pg_query/include/postgres/catalog/pg_authid_d.h +60 -0
  80. data/ext/pg_query/include/postgres/catalog/pg_class.h +235 -0
  81. data/ext/pg_query/include/postgres/catalog/pg_class_d.h +134 -0
  82. data/ext/pg_query/include/postgres/catalog/pg_collation.h +106 -0
  83. data/ext/pg_query/include/postgres/catalog/pg_collation_d.h +66 -0
  84. data/ext/pg_query/include/postgres/catalog/pg_constraint.h +278 -0
  85. data/ext/pg_query/include/postgres/catalog/pg_constraint_d.h +74 -0
  86. data/ext/pg_query/include/postgres/catalog/pg_control.h +260 -0
  87. data/ext/pg_query/include/postgres/catalog/pg_conversion.h +79 -0
  88. data/ext/pg_query/include/postgres/catalog/pg_conversion_d.h +38 -0
  89. data/ext/pg_query/include/postgres/catalog/pg_database.h +129 -0
  90. data/ext/pg_query/include/postgres/catalog/pg_database_d.h +53 -0
  91. data/ext/pg_query/include/postgres/catalog/pg_depend.h +77 -0
  92. data/ext/pg_query/include/postgres/catalog/pg_depend_d.h +36 -0
  93. data/ext/pg_query/include/postgres/catalog/pg_event_trigger.h +60 -0
  94. data/ext/pg_query/include/postgres/catalog/pg_event_trigger_d.h +36 -0
  95. data/ext/pg_query/include/postgres/catalog/pg_index.h +92 -0
  96. data/ext/pg_query/include/postgres/catalog/pg_index_d.h +59 -0
  97. data/ext/pg_query/include/postgres/catalog/pg_language.h +75 -0
  98. data/ext/pg_query/include/postgres/catalog/pg_language_d.h +41 -0
  99. data/ext/pg_query/include/postgres/catalog/pg_namespace.h +67 -0
  100. data/ext/pg_query/include/postgres/catalog/pg_namespace_d.h +36 -0
  101. data/ext/pg_query/include/postgres/catalog/pg_opclass.h +91 -0
  102. data/ext/pg_query/include/postgres/catalog/pg_opclass_d.h +51 -0
  103. data/ext/pg_query/include/postgres/catalog/pg_operator.h +124 -0
  104. data/ext/pg_query/include/postgres/catalog/pg_operator_d.h +142 -0
  105. data/ext/pg_query/include/postgres/catalog/pg_opfamily.h +67 -0
  106. data/ext/pg_query/include/postgres/catalog/pg_opfamily_d.h +51 -0
  107. data/ext/pg_query/include/postgres/catalog/pg_partitioned_table.h +76 -0
  108. data/ext/pg_query/include/postgres/catalog/pg_partitioned_table_d.h +36 -0
  109. data/ext/pg_query/include/postgres/catalog/pg_proc.h +223 -0
  110. data/ext/pg_query/include/postgres/catalog/pg_proc_d.h +101 -0
  111. data/ext/pg_query/include/postgres/catalog/pg_publication.h +161 -0
  112. data/ext/pg_query/include/postgres/catalog/pg_publication_d.h +38 -0
  113. data/ext/pg_query/include/postgres/catalog/pg_replication_origin.h +65 -0
  114. data/ext/pg_query/include/postgres/catalog/pg_replication_origin_d.h +33 -0
  115. data/ext/pg_query/include/postgres/catalog/pg_statistic.h +288 -0
  116. data/ext/pg_query/include/postgres/catalog/pg_statistic_d.h +199 -0
  117. data/ext/pg_query/include/postgres/catalog/pg_statistic_ext.h +91 -0
  118. data/ext/pg_query/include/postgres/catalog/pg_statistic_ext_d.h +45 -0
  119. data/ext/pg_query/include/postgres/catalog/pg_transform.h +51 -0
  120. data/ext/pg_query/include/postgres/catalog/pg_transform_d.h +34 -0
  121. data/ext/pg_query/include/postgres/catalog/pg_trigger.h +153 -0
  122. data/ext/pg_query/include/postgres/catalog/pg_trigger_d.h +109 -0
  123. data/ext/pg_query/include/postgres/catalog/pg_ts_config.h +56 -0
  124. data/ext/pg_query/include/postgres/catalog/pg_ts_config_d.h +34 -0
  125. data/ext/pg_query/include/postgres/catalog/pg_ts_dict.h +62 -0
  126. data/ext/pg_query/include/postgres/catalog/pg_ts_dict_d.h +35 -0
  127. data/ext/pg_query/include/postgres/catalog/pg_ts_parser.h +63 -0
  128. data/ext/pg_query/include/postgres/catalog/pg_ts_parser_d.h +37 -0
  129. data/ext/pg_query/include/postgres/catalog/pg_ts_template.h +54 -0
  130. data/ext/pg_query/include/postgres/catalog/pg_ts_template_d.h +34 -0
  131. data/ext/pg_query/include/postgres/catalog/pg_type.h +407 -0
  132. data/ext/pg_query/include/postgres/catalog/pg_type_d.h +324 -0
  133. data/ext/pg_query/include/postgres/catalog/storage.h +50 -0
  134. data/ext/pg_query/include/postgres/catalog/syscache_ids.h +104 -0
  135. data/ext/pg_query/include/postgres/commands/async.h +49 -0
  136. data/ext/pg_query/include/postgres/commands/dbcommands.h +37 -0
  137. data/ext/pg_query/include/postgres/commands/defrem.h +161 -0
  138. data/ext/pg_query/include/postgres/commands/event_trigger.h +97 -0
  139. data/ext/pg_query/include/postgres/commands/explain.h +145 -0
  140. data/ext/pg_query/include/postgres/commands/prepare.h +61 -0
  141. data/ext/pg_query/include/postgres/commands/tablespace.h +69 -0
  142. data/ext/pg_query/include/postgres/commands/trigger.h +288 -0
  143. data/ext/pg_query/include/postgres/commands/user.h +43 -0
  144. data/ext/pg_query/include/postgres/commands/vacuum.h +388 -0
  145. data/ext/pg_query/include/postgres/common/cryptohash.h +39 -0
  146. data/ext/pg_query/include/postgres/common/file_perm.h +56 -0
  147. data/ext/pg_query/include/postgres/common/file_utils.h +65 -0
  148. data/ext/pg_query/include/postgres/common/hashfn.h +119 -0
  149. data/ext/pg_query/include/postgres/common/hashfn_unstable.h +407 -0
  150. data/ext/pg_query/include/postgres/common/int.h +512 -0
  151. data/ext/pg_query/include/postgres/common/keywords.h +29 -0
  152. data/ext/pg_query/include/postgres/common/kwlookup.h +44 -0
  153. data/ext/pg_query/include/postgres/common/pg_prng.h +62 -0
  154. data/ext/pg_query/include/postgres/common/relpath.h +97 -0
  155. data/ext/pg_query/include/postgres/common/scram-common.h +70 -0
  156. data/ext/pg_query/include/postgres/common/sha2.h +32 -0
  157. data/ext/pg_query/include/postgres/common/string.h +44 -0
  158. data/ext/pg_query/include/postgres/common/unicode_east_asian_fw_table.h +124 -0
  159. data/ext/pg_query/include/postgres/common/unicode_nonspacing_table.h +326 -0
  160. data/ext/pg_query/include/postgres/copyfuncs.funcs.c +5261 -0
  161. data/ext/pg_query/include/postgres/copyfuncs.switch.c +989 -0
  162. data/ext/pg_query/include/postgres/datatype/timestamp.h +269 -0
  163. data/ext/pg_query/include/postgres/equalfuncs.funcs.c +3310 -0
  164. data/ext/pg_query/include/postgres/equalfuncs.switch.c +836 -0
  165. data/ext/pg_query/include/postgres/executor/execdesc.h +70 -0
  166. data/ext/pg_query/include/postgres/executor/executor.h +681 -0
  167. data/ext/pg_query/include/postgres/executor/functions.h +56 -0
  168. data/ext/pg_query/include/postgres/executor/instrument.h +120 -0
  169. data/ext/pg_query/include/postgres/executor/spi.h +207 -0
  170. data/ext/pg_query/include/postgres/executor/tablefunc.h +67 -0
  171. data/ext/pg_query/include/postgres/executor/tuptable.h +523 -0
  172. data/ext/pg_query/include/postgres/fmgr.h +800 -0
  173. data/ext/pg_query/include/postgres/foreign/fdwapi.h +294 -0
  174. data/ext/pg_query/include/postgres/funcapi.h +360 -0
  175. data/ext/pg_query/include/postgres/gram.h +1168 -0
  176. data/ext/pg_query/include/postgres/gramparse.h +75 -0
  177. data/ext/pg_query/include/postgres/jit/jit.h +106 -0
  178. data/ext/pg_query/include/postgres/kwlist_d.h +1164 -0
  179. data/ext/pg_query/include/postgres/lib/dshash.h +130 -0
  180. data/ext/pg_query/include/postgres/lib/ilist.h +1159 -0
  181. data/ext/pg_query/include/postgres/lib/pairingheap.h +102 -0
  182. data/ext/pg_query/include/postgres/lib/simplehash.h +1206 -0
  183. data/ext/pg_query/include/postgres/lib/sort_template.h +445 -0
  184. data/ext/pg_query/include/postgres/lib/stringinfo.h +243 -0
  185. data/ext/pg_query/include/postgres/libpq/auth.h +37 -0
  186. data/ext/pg_query/include/postgres/libpq/crypt.h +47 -0
  187. data/ext/pg_query/include/postgres/libpq/hba.h +186 -0
  188. data/ext/pg_query/include/postgres/libpq/libpq-be.h +361 -0
  189. data/ext/pg_query/include/postgres/libpq/libpq.h +143 -0
  190. data/ext/pg_query/include/postgres/libpq/pqcomm.h +169 -0
  191. data/ext/pg_query/include/postgres/libpq/pqformat.h +209 -0
  192. data/ext/pg_query/include/postgres/libpq/pqsignal.h +54 -0
  193. data/ext/pg_query/include/postgres/libpq/protocol.h +89 -0
  194. data/ext/pg_query/include/postgres/libpq/sasl.h +136 -0
  195. data/ext/pg_query/include/postgres/libpq/scram.h +37 -0
  196. data/ext/pg_query/include/postgres/mb/pg_wchar.h +793 -0
  197. data/ext/pg_query/include/postgres/mb/stringinfo_mb.h +24 -0
  198. data/ext/pg_query/include/postgres/miscadmin.h +527 -0
  199. data/ext/pg_query/include/postgres/nodes/bitmapset.h +140 -0
  200. data/ext/pg_query/include/postgres/nodes/execnodes.h +2855 -0
  201. data/ext/pg_query/include/postgres/nodes/extensible.h +164 -0
  202. data/ext/pg_query/include/postgres/nodes/lockoptions.h +61 -0
  203. data/ext/pg_query/include/postgres/nodes/makefuncs.h +127 -0
  204. data/ext/pg_query/include/postgres/nodes/memnodes.h +152 -0
  205. data/ext/pg_query/include/postgres/nodes/miscnodes.h +56 -0
  206. data/ext/pg_query/include/postgres/nodes/nodeFuncs.h +222 -0
  207. data/ext/pg_query/include/postgres/nodes/nodes.h +435 -0
  208. data/ext/pg_query/include/postgres/nodes/nodetags.h +491 -0
  209. data/ext/pg_query/include/postgres/nodes/params.h +170 -0
  210. data/ext/pg_query/include/postgres/nodes/parsenodes.h +4233 -0
  211. data/ext/pg_query/include/postgres/nodes/pathnodes.h +3438 -0
  212. data/ext/pg_query/include/postgres/nodes/pg_list.h +686 -0
  213. data/ext/pg_query/include/postgres/nodes/plannodes.h +1593 -0
  214. data/ext/pg_query/include/postgres/nodes/primnodes.h +2339 -0
  215. data/ext/pg_query/include/postgres/nodes/print.h +34 -0
  216. data/ext/pg_query/include/postgres/nodes/queryjumble.h +86 -0
  217. data/ext/pg_query/include/postgres/nodes/replnodes.h +132 -0
  218. data/ext/pg_query/include/postgres/nodes/supportnodes.h +346 -0
  219. data/ext/pg_query/include/postgres/nodes/tidbitmap.h +75 -0
  220. data/ext/pg_query/include/postgres/nodes/value.h +90 -0
  221. data/ext/pg_query/include/postgres/optimizer/cost.h +216 -0
  222. data/ext/pg_query/include/postgres/optimizer/geqo.h +90 -0
  223. data/ext/pg_query/include/postgres/optimizer/geqo_gene.h +45 -0
  224. data/ext/pg_query/include/postgres/optimizer/optimizer.h +205 -0
  225. data/ext/pg_query/include/postgres/optimizer/paths.h +271 -0
  226. data/ext/pg_query/include/postgres/optimizer/planmain.h +123 -0
  227. data/ext/pg_query/include/postgres/parser/analyze.h +66 -0
  228. data/ext/pg_query/include/postgres/parser/kwlist.h +518 -0
  229. data/ext/pg_query/include/postgres/parser/parse_agg.h +65 -0
  230. data/ext/pg_query/include/postgres/parser/parse_coerce.h +105 -0
  231. data/ext/pg_query/include/postgres/parser/parse_expr.h +25 -0
  232. data/ext/pg_query/include/postgres/parser/parse_func.h +74 -0
  233. data/ext/pg_query/include/postgres/parser/parse_node.h +358 -0
  234. data/ext/pg_query/include/postgres/parser/parse_oper.h +68 -0
  235. data/ext/pg_query/include/postgres/parser/parse_relation.h +129 -0
  236. data/ext/pg_query/include/postgres/parser/parse_type.h +61 -0
  237. data/ext/pg_query/include/postgres/parser/parser.h +68 -0
  238. data/ext/pg_query/include/postgres/parser/parsetree.h +61 -0
  239. data/ext/pg_query/include/postgres/parser/scanner.h +152 -0
  240. data/ext/pg_query/include/postgres/parser/scansup.h +27 -0
  241. data/ext/pg_query/include/postgres/partitioning/partdefs.h +26 -0
  242. data/ext/pg_query/include/postgres/pg_config.h +985 -0
  243. data/ext/pg_query/include/postgres/pg_config_manual.h +385 -0
  244. data/ext/pg_query/include/postgres/pg_config_os.h +8 -0
  245. data/ext/pg_query/include/postgres/pg_getopt.h +56 -0
  246. data/ext/pg_query/include/postgres/pg_trace.h +17 -0
  247. data/ext/pg_query/include/postgres/pgstat.h +780 -0
  248. data/ext/pg_query/include/postgres/pgtime.h +94 -0
  249. data/ext/pg_query/include/postgres/pl_gram.h +385 -0
  250. data/ext/pg_query/include/postgres/pl_reserved_kwlist.h +52 -0
  251. data/ext/pg_query/include/postgres/pl_reserved_kwlist_d.h +114 -0
  252. data/ext/pg_query/include/postgres/pl_unreserved_kwlist.h +112 -0
  253. data/ext/pg_query/include/postgres/pl_unreserved_kwlist_d.h +246 -0
  254. data/ext/pg_query/include/postgres/plerrcodes.h +998 -0
  255. data/ext/pg_query/include/postgres/plpgsql.h +1342 -0
  256. data/ext/pg_query/include/postgres/port/atomics/arch-arm.h +32 -0
  257. data/ext/pg_query/include/postgres/port/atomics/arch-hppa.h +17 -0
  258. data/ext/pg_query/include/postgres/port/atomics/arch-ppc.h +256 -0
  259. data/ext/pg_query/include/postgres/port/atomics/arch-x86.h +254 -0
  260. data/ext/pg_query/include/postgres/port/atomics/fallback.h +170 -0
  261. data/ext/pg_query/include/postgres/port/atomics/generic-gcc.h +323 -0
  262. data/ext/pg_query/include/postgres/port/atomics/generic-msvc.h +119 -0
  263. data/ext/pg_query/include/postgres/port/atomics/generic-sunpro.h +121 -0
  264. data/ext/pg_query/include/postgres/port/atomics/generic.h +437 -0
  265. data/ext/pg_query/include/postgres/port/atomics.h +606 -0
  266. data/ext/pg_query/include/postgres/port/pg_bitutils.h +421 -0
  267. data/ext/pg_query/include/postgres/port/pg_bswap.h +161 -0
  268. data/ext/pg_query/include/postgres/port/pg_crc32c.h +110 -0
  269. data/ext/pg_query/include/postgres/port/pg_iovec.h +117 -0
  270. data/ext/pg_query/include/postgres/port/simd.h +422 -0
  271. data/ext/pg_query/include/postgres/port/win32/arpa/inet.h +3 -0
  272. data/ext/pg_query/include/postgres/port/win32/dlfcn.h +1 -0
  273. data/ext/pg_query/include/postgres/port/win32/grp.h +1 -0
  274. data/ext/pg_query/include/postgres/port/win32/netdb.h +7 -0
  275. data/ext/pg_query/include/postgres/port/win32/netinet/in.h +3 -0
  276. data/ext/pg_query/include/postgres/port/win32/netinet/tcp.h +7 -0
  277. data/ext/pg_query/include/postgres/port/win32/pwd.h +3 -0
  278. data/ext/pg_query/include/postgres/port/win32/sys/resource.h +20 -0
  279. data/ext/pg_query/include/postgres/port/win32/sys/select.h +3 -0
  280. data/ext/pg_query/include/postgres/port/win32/sys/socket.h +34 -0
  281. data/ext/pg_query/include/postgres/port/win32/sys/un.h +17 -0
  282. data/ext/pg_query/include/postgres/port/win32/sys/wait.h +3 -0
  283. data/ext/pg_query/include/postgres/port/win32.h +59 -0
  284. data/ext/pg_query/include/postgres/port/win32_msvc/dirent.h +34 -0
  285. data/ext/pg_query/include/postgres/port/win32_msvc/sys/file.h +1 -0
  286. data/ext/pg_query/include/postgres/port/win32_msvc/sys/param.h +1 -0
  287. data/ext/pg_query/include/postgres/port/win32_msvc/sys/time.h +1 -0
  288. data/ext/pg_query/include/postgres/port/win32_msvc/unistd.h +9 -0
  289. data/ext/pg_query/include/postgres/port/win32_msvc/utime.h +3 -0
  290. data/ext/pg_query/include/postgres/port/win32_port.h +582 -0
  291. data/ext/pg_query/include/postgres/port.h +555 -0
  292. data/ext/pg_query/include/postgres/portability/instr_time.h +197 -0
  293. data/ext/pg_query/include/postgres/postgres.h +579 -0
  294. data/ext/pg_query/include/postgres/postgres_ext.h +73 -0
  295. data/ext/pg_query/include/postgres/postmaster/autovacuum.h +69 -0
  296. data/ext/pg_query/include/postgres/postmaster/bgworker.h +164 -0
  297. data/ext/pg_query/include/postgres/postmaster/bgworker_internals.h +60 -0
  298. data/ext/pg_query/include/postgres/postmaster/bgwriter.h +45 -0
  299. data/ext/pg_query/include/postgres/postmaster/interrupt.h +32 -0
  300. data/ext/pg_query/include/postgres/postmaster/pgarch.h +36 -0
  301. data/ext/pg_query/include/postgres/postmaster/postmaster.h +101 -0
  302. data/ext/pg_query/include/postgres/postmaster/startup.h +41 -0
  303. data/ext/pg_query/include/postgres/postmaster/syslogger.h +101 -0
  304. data/ext/pg_query/include/postgres/postmaster/walsummarizer.h +35 -0
  305. data/ext/pg_query/include/postgres/postmaster/walwriter.h +23 -0
  306. data/ext/pg_query/include/postgres/regex/regex.h +272 -0
  307. data/ext/pg_query/include/postgres/replication/logicallauncher.h +34 -0
  308. data/ext/pg_query/include/postgres/replication/logicalproto.h +274 -0
  309. data/ext/pg_query/include/postgres/replication/logicalworker.h +33 -0
  310. data/ext/pg_query/include/postgres/replication/origin.h +73 -0
  311. data/ext/pg_query/include/postgres/replication/reorderbuffer.h +734 -0
  312. data/ext/pg_query/include/postgres/replication/slot.h +289 -0
  313. data/ext/pg_query/include/postgres/replication/slotsync.h +38 -0
  314. data/ext/pg_query/include/postgres/replication/syncrep.h +109 -0
  315. data/ext/pg_query/include/postgres/replication/walreceiver.h +504 -0
  316. data/ext/pg_query/include/postgres/replication/walsender.h +76 -0
  317. data/ext/pg_query/include/postgres/rewrite/prs2lock.h +46 -0
  318. data/ext/pg_query/include/postgres/rewrite/rewriteHandler.h +41 -0
  319. data/ext/pg_query/include/postgres/rewrite/rewriteManip.h +96 -0
  320. data/ext/pg_query/include/postgres/rewrite/rewriteSupport.h +26 -0
  321. data/ext/pg_query/include/postgres/storage/block.h +108 -0
  322. data/ext/pg_query/include/postgres/storage/buf.h +46 -0
  323. data/ext/pg_query/include/postgres/storage/bufmgr.h +411 -0
  324. data/ext/pg_query/include/postgres/storage/bufpage.h +510 -0
  325. data/ext/pg_query/include/postgres/storage/condition_variable.h +73 -0
  326. data/ext/pg_query/include/postgres/storage/dsm.h +61 -0
  327. data/ext/pg_query/include/postgres/storage/dsm_impl.h +79 -0
  328. data/ext/pg_query/include/postgres/storage/fd.h +219 -0
  329. data/ext/pg_query/include/postgres/storage/fileset.h +40 -0
  330. data/ext/pg_query/include/postgres/storage/ipc.h +87 -0
  331. data/ext/pg_query/include/postgres/storage/item.h +19 -0
  332. data/ext/pg_query/include/postgres/storage/itemid.h +184 -0
  333. data/ext/pg_query/include/postgres/storage/itemptr.h +245 -0
  334. data/ext/pg_query/include/postgres/storage/large_object.h +100 -0
  335. data/ext/pg_query/include/postgres/storage/latch.h +196 -0
  336. data/ext/pg_query/include/postgres/storage/lmgr.h +126 -0
  337. data/ext/pg_query/include/postgres/storage/lock.h +624 -0
  338. data/ext/pg_query/include/postgres/storage/lockdefs.h +61 -0
  339. data/ext/pg_query/include/postgres/storage/lwlock.h +228 -0
  340. data/ext/pg_query/include/postgres/storage/lwlocknames.h +47 -0
  341. data/ext/pg_query/include/postgres/storage/off.h +57 -0
  342. data/ext/pg_query/include/postgres/storage/pg_sema.h +61 -0
  343. data/ext/pg_query/include/postgres/storage/pg_shmem.h +93 -0
  344. data/ext/pg_query/include/postgres/storage/pmsignal.h +105 -0
  345. data/ext/pg_query/include/postgres/storage/predicate.h +83 -0
  346. data/ext/pg_query/include/postgres/storage/proc.h +488 -0
  347. data/ext/pg_query/include/postgres/storage/procarray.h +103 -0
  348. data/ext/pg_query/include/postgres/storage/proclist_types.h +53 -0
  349. data/ext/pg_query/include/postgres/storage/procnumber.h +43 -0
  350. data/ext/pg_query/include/postgres/storage/procsignal.h +75 -0
  351. data/ext/pg_query/include/postgres/storage/read_stream.h +65 -0
  352. data/ext/pg_query/include/postgres/storage/relfilelocator.h +100 -0
  353. data/ext/pg_query/include/postgres/storage/s_lock.h +847 -0
  354. data/ext/pg_query/include/postgres/storage/sharedfileset.h +37 -0
  355. data/ext/pg_query/include/postgres/storage/shm_mq.h +86 -0
  356. data/ext/pg_query/include/postgres/storage/shm_toc.h +58 -0
  357. data/ext/pg_query/include/postgres/storage/shmem.h +59 -0
  358. data/ext/pg_query/include/postgres/storage/sinval.h +153 -0
  359. data/ext/pg_query/include/postgres/storage/smgr.h +130 -0
  360. data/ext/pg_query/include/postgres/storage/spin.h +77 -0
  361. data/ext/pg_query/include/postgres/storage/standby.h +109 -0
  362. data/ext/pg_query/include/postgres/storage/standbydefs.h +74 -0
  363. data/ext/pg_query/include/postgres/storage/sync.h +66 -0
  364. data/ext/pg_query/include/postgres/tcop/cmdtag.h +62 -0
  365. data/ext/pg_query/include/postgres/tcop/cmdtaglist.h +219 -0
  366. data/ext/pg_query/include/postgres/tcop/deparse_utility.h +108 -0
  367. data/ext/pg_query/include/postgres/tcop/dest.h +148 -0
  368. data/ext/pg_query/include/postgres/tcop/fastpath.h +20 -0
  369. data/ext/pg_query/include/postgres/tcop/pquery.h +51 -0
  370. data/ext/pg_query/include/postgres/tcop/tcopprot.h +98 -0
  371. data/ext/pg_query/include/postgres/tcop/utility.h +112 -0
  372. data/ext/pg_query/include/postgres/tsearch/ts_cache.h +96 -0
  373. data/ext/pg_query/include/postgres/utils/acl.h +290 -0
  374. data/ext/pg_query/include/postgres/utils/aclchk_internal.h +45 -0
  375. data/ext/pg_query/include/postgres/utils/array.h +481 -0
  376. data/ext/pg_query/include/postgres/utils/ascii.h +84 -0
  377. data/ext/pg_query/include/postgres/utils/backend_progress.h +46 -0
  378. data/ext/pg_query/include/postgres/utils/backend_status.h +340 -0
  379. data/ext/pg_query/include/postgres/utils/builtins.h +139 -0
  380. data/ext/pg_query/include/postgres/utils/bytea.h +28 -0
  381. data/ext/pg_query/include/postgres/utils/catcache.h +231 -0
  382. data/ext/pg_query/include/postgres/utils/date.h +118 -0
  383. data/ext/pg_query/include/postgres/utils/datetime.h +367 -0
  384. data/ext/pg_query/include/postgres/utils/datum.h +76 -0
  385. data/ext/pg_query/include/postgres/utils/dsa.h +166 -0
  386. data/ext/pg_query/include/postgres/utils/elog.h +540 -0
  387. data/ext/pg_query/include/postgres/utils/errcodes.h +352 -0
  388. data/ext/pg_query/include/postgres/utils/expandeddatum.h +170 -0
  389. data/ext/pg_query/include/postgres/utils/expandedrecord.h +241 -0
  390. data/ext/pg_query/include/postgres/utils/float.h +357 -0
  391. data/ext/pg_query/include/postgres/utils/fmgroids.h +3347 -0
  392. data/ext/pg_query/include/postgres/utils/fmgrprotos.h +2904 -0
  393. data/ext/pg_query/include/postgres/utils/fmgrtab.h +49 -0
  394. data/ext/pg_query/include/postgres/utils/guc.h +456 -0
  395. data/ext/pg_query/include/postgres/utils/guc_hooks.h +184 -0
  396. data/ext/pg_query/include/postgres/utils/guc_tables.h +323 -0
  397. data/ext/pg_query/include/postgres/utils/hsearch.h +153 -0
  398. data/ext/pg_query/include/postgres/utils/injection_point.h +44 -0
  399. data/ext/pg_query/include/postgres/utils/inval.h +68 -0
  400. data/ext/pg_query/include/postgres/utils/logtape.h +77 -0
  401. data/ext/pg_query/include/postgres/utils/lsyscache.h +215 -0
  402. data/ext/pg_query/include/postgres/utils/memdebug.h +82 -0
  403. data/ext/pg_query/include/postgres/utils/memutils.h +193 -0
  404. data/ext/pg_query/include/postgres/utils/memutils_internal.h +176 -0
  405. data/ext/pg_query/include/postgres/utils/memutils_memorychunk.h +253 -0
  406. data/ext/pg_query/include/postgres/utils/numeric.h +110 -0
  407. data/ext/pg_query/include/postgres/utils/palloc.h +151 -0
  408. data/ext/pg_query/include/postgres/utils/partcache.h +103 -0
  409. data/ext/pg_query/include/postgres/utils/pg_locale.h +136 -0
  410. data/ext/pg_query/include/postgres/utils/pgstat_internal.h +827 -0
  411. data/ext/pg_query/include/postgres/utils/plancache.h +238 -0
  412. data/ext/pg_query/include/postgres/utils/portal.h +252 -0
  413. data/ext/pg_query/include/postgres/utils/probes.h +114 -0
  414. data/ext/pg_query/include/postgres/utils/ps_status.h +47 -0
  415. data/ext/pg_query/include/postgres/utils/queryenvironment.h +74 -0
  416. data/ext/pg_query/include/postgres/utils/regproc.h +39 -0
  417. data/ext/pg_query/include/postgres/utils/rel.h +711 -0
  418. data/ext/pg_query/include/postgres/utils/relcache.h +155 -0
  419. data/ext/pg_query/include/postgres/utils/reltrigger.h +81 -0
  420. data/ext/pg_query/include/postgres/utils/resowner.h +167 -0
  421. data/ext/pg_query/include/postgres/utils/ruleutils.h +52 -0
  422. data/ext/pg_query/include/postgres/utils/sharedtuplestore.h +61 -0
  423. data/ext/pg_query/include/postgres/utils/snapmgr.h +130 -0
  424. data/ext/pg_query/include/postgres/utils/snapshot.h +219 -0
  425. data/ext/pg_query/include/postgres/utils/sortsupport.h +391 -0
  426. data/ext/pg_query/include/postgres/utils/syscache.h +136 -0
  427. data/ext/pg_query/include/postgres/utils/timeout.h +96 -0
  428. data/ext/pg_query/include/postgres/utils/timestamp.h +147 -0
  429. data/ext/pg_query/include/postgres/utils/tuplesort.h +472 -0
  430. data/ext/pg_query/include/postgres/utils/tuplestore.h +88 -0
  431. data/ext/pg_query/include/postgres/utils/typcache.h +210 -0
  432. data/ext/pg_query/include/postgres/utils/varlena.h +53 -0
  433. data/ext/pg_query/include/postgres/utils/wait_event.h +108 -0
  434. data/ext/pg_query/include/postgres/utils/wait_event_types.h +218 -0
  435. data/ext/pg_query/include/postgres/utils/xml.h +94 -0
  436. data/ext/pg_query/include/postgres/varatt.h +358 -0
  437. data/ext/pg_query/include/protobuf/pg_query.pb-c.h +7723 -6368
  438. data/ext/pg_query/include/protobuf/pg_query.pb.h +120022 -87031
  439. data/ext/pg_query/pg_query.c +10 -1
  440. data/ext/pg_query/pg_query.pb-c.c +22595 -17738
  441. data/ext/pg_query/pg_query_deparse.c +1 -10635
  442. data/ext/pg_query/pg_query_fingerprint.c +12 -8
  443. data/ext/pg_query/pg_query_fingerprint.h +1 -1
  444. data/ext/pg_query/pg_query_internal.h +1 -1
  445. data/ext/pg_query/pg_query_json_plpgsql.c +1 -0
  446. data/ext/pg_query/pg_query_normalize.c +43 -2
  447. data/ext/pg_query/pg_query_outfuncs_json.c +9 -1
  448. data/ext/pg_query/pg_query_outfuncs_protobuf.c +3 -2
  449. data/ext/pg_query/pg_query_parse.c +47 -5
  450. data/ext/pg_query/pg_query_parse_plpgsql.c +19 -18
  451. data/ext/pg_query/pg_query_readfuncs_protobuf.c +3 -2
  452. data/ext/pg_query/pg_query_ruby.c +5 -0
  453. data/ext/pg_query/pg_query_scan.c +2 -2
  454. data/ext/pg_query/pg_query_split.c +3 -3
  455. data/ext/pg_query/postgres_deparse.c +11496 -0
  456. data/ext/pg_query/postgres_deparse.h +9 -0
  457. data/ext/pg_query/src_backend_catalog_namespace.c +243 -63
  458. data/ext/pg_query/src_backend_catalog_pg_proc.c +1 -3
  459. data/ext/pg_query/src_backend_commands_define.c +2 -3
  460. data/ext/pg_query/src_backend_nodes_bitmapset.c +140 -156
  461. data/ext/pg_query/src_backend_nodes_copyfuncs.c +96 -6202
  462. data/ext/pg_query/src_backend_nodes_equalfuncs.c +95 -4068
  463. data/ext/pg_query/src_backend_nodes_extensible.c +6 -29
  464. data/ext/pg_query/src_backend_nodes_list.c +16 -8
  465. data/ext/pg_query/src_backend_nodes_makefuncs.c +134 -1
  466. data/ext/pg_query/src_backend_nodes_nodeFuncs.c +391 -133
  467. data/ext/pg_query/src_backend_nodes_value.c +1 -1
  468. data/ext/pg_query/src_backend_parser_gram.c +43710 -39953
  469. data/ext/pg_query/src_backend_parser_parser.c +34 -8
  470. data/ext/pg_query/src_backend_parser_scan.c +6971 -3373
  471. data/ext/pg_query/src_backend_parser_scansup.c +2 -1
  472. data/ext/pg_query/src_backend_storage_ipc_ipc.c +1 -1
  473. data/ext/pg_query/src_backend_tcop_postgres.c +99 -96
  474. data/ext/pg_query/src_backend_utils_activity_pgstat_database.c +2 -2
  475. data/ext/pg_query/src_backend_utils_adt_datum.c +2 -2
  476. data/ext/pg_query/src_backend_utils_adt_expandeddatum.c +1 -1
  477. data/ext/pg_query/src_backend_utils_adt_format_type.c +1 -1
  478. data/ext/pg_query/src_backend_utils_adt_numutils.c +488 -0
  479. data/ext/pg_query/src_backend_utils_adt_ruleutils.c +177 -30
  480. data/ext/pg_query/src_backend_utils_error_assert.c +4 -7
  481. data/ext/pg_query/src_backend_utils_error_elog.c +397 -270
  482. data/ext/pg_query/src_backend_utils_fmgr_fmgr.c +36 -2
  483. data/ext/pg_query/src_backend_utils_init_globals.c +20 -5
  484. data/ext/pg_query/src_backend_utils_mb_mbutils.c +31 -84
  485. data/ext/pg_query/src_backend_utils_misc_guc_tables.c +502 -0
  486. data/ext/pg_query/src_backend_utils_mmgr_alignedalloc.c +166 -0
  487. data/ext/pg_query/src_backend_utils_mmgr_aset.c +704 -497
  488. data/ext/pg_query/src_backend_utils_mmgr_bump.c +728 -0
  489. data/ext/pg_query/src_backend_utils_mmgr_generation.c +1115 -0
  490. data/ext/pg_query/src_backend_utils_mmgr_mcxt.c +637 -233
  491. data/ext/pg_query/src_backend_utils_mmgr_slab.c +1079 -0
  492. data/ext/pg_query/src_common_encnames.c +46 -44
  493. data/ext/pg_query/src_common_hashfn.c +1 -1
  494. data/ext/pg_query/src_common_keywords.c +1 -1
  495. data/ext/pg_query/src_common_kwlist_d.h +586 -517
  496. data/ext/pg_query/src_common_kwlookup.c +1 -1
  497. data/ext/pg_query/src_common_psprintf.c +3 -3
  498. data/ext/pg_query/src_common_stringinfo.c +21 -4
  499. data/ext/pg_query/src_common_wchar.c +100 -116
  500. data/ext/pg_query/src_pl_plpgsql_src_pl_comp.c +99 -5
  501. data/ext/pg_query/src_pl_plpgsql_src_pl_funcs.c +3 -1
  502. data/ext/pg_query/src_pl_plpgsql_src_pl_gram.c +829 -763
  503. data/ext/pg_query/src_pl_plpgsql_src_pl_handler.c +1 -1
  504. data/ext/pg_query/src_pl_plpgsql_src_pl_reserved_kwlist_d.h +1 -1
  505. data/ext/pg_query/src_pl_plpgsql_src_pl_scanner.c +19 -1
  506. data/ext/pg_query/src_pl_plpgsql_src_pl_unreserved_kwlist_d.h +48 -46
  507. data/ext/pg_query/src_port_pg_bitutils.c +251 -32
  508. data/ext/pg_query/src_port_pgstrcasecmp.c +57 -1
  509. data/ext/pg_query/src_port_snprintf.c +20 -27
  510. data/ext/pg_query/src_port_strerror.c +1 -3
  511. data/ext/pg_query/src_port_strlcpy.c +79 -0
  512. data/lib/pg_query/fingerprint.rb +5 -8
  513. data/lib/pg_query/node.rb +16 -11
  514. data/lib/pg_query/param_refs.rb +2 -2
  515. data/lib/pg_query/parse.rb +6 -8
  516. data/lib/pg_query/parse_error.rb +1 -0
  517. data/lib/pg_query/pg_query_pb.rb +173 -3196
  518. data/lib/pg_query/scan.rb +1 -0
  519. data/lib/pg_query/treewalker.rb +52 -11
  520. data/lib/pg_query/truncate.rb +18 -20
  521. data/lib/pg_query/version.rb +1 -1
  522. metadata +443 -442
  523. data/ext/pg_query/guc-file.c +0 -0
  524. data/ext/pg_query/include/access/amapi.h +0 -290
  525. data/ext/pg_query/include/access/attmap.h +0 -52
  526. data/ext/pg_query/include/access/attnum.h +0 -64
  527. data/ext/pg_query/include/access/clog.h +0 -63
  528. data/ext/pg_query/include/access/commit_ts.h +0 -74
  529. data/ext/pg_query/include/access/detoast.h +0 -82
  530. data/ext/pg_query/include/access/genam.h +0 -231
  531. data/ext/pg_query/include/access/gin.h +0 -78
  532. data/ext/pg_query/include/access/htup.h +0 -89
  533. data/ext/pg_query/include/access/htup_details.h +0 -807
  534. data/ext/pg_query/include/access/itup.h +0 -167
  535. data/ext/pg_query/include/access/parallel.h +0 -82
  536. data/ext/pg_query/include/access/printtup.h +0 -35
  537. data/ext/pg_query/include/access/relation.h +0 -28
  538. data/ext/pg_query/include/access/relscan.h +0 -191
  539. data/ext/pg_query/include/access/rmgrlist.h +0 -49
  540. data/ext/pg_query/include/access/sdir.h +0 -58
  541. data/ext/pg_query/include/access/skey.h +0 -151
  542. data/ext/pg_query/include/access/stratnum.h +0 -85
  543. data/ext/pg_query/include/access/sysattr.h +0 -29
  544. data/ext/pg_query/include/access/table.h +0 -28
  545. data/ext/pg_query/include/access/tableam.h +0 -2077
  546. data/ext/pg_query/include/access/toast_compression.h +0 -73
  547. data/ext/pg_query/include/access/transam.h +0 -375
  548. data/ext/pg_query/include/access/tupconvert.h +0 -51
  549. data/ext/pg_query/include/access/tupdesc.h +0 -154
  550. data/ext/pg_query/include/access/tupmacs.h +0 -247
  551. data/ext/pg_query/include/access/twophase.h +0 -65
  552. data/ext/pg_query/include/access/xact.h +0 -523
  553. data/ext/pg_query/include/access/xlog.h +0 -303
  554. data/ext/pg_query/include/access/xlog_internal.h +0 -366
  555. data/ext/pg_query/include/access/xlogdefs.h +0 -101
  556. data/ext/pg_query/include/access/xlogprefetcher.h +0 -55
  557. data/ext/pg_query/include/access/xlogreader.h +0 -443
  558. data/ext/pg_query/include/access/xlogrecord.h +0 -236
  559. data/ext/pg_query/include/access/xlogrecovery.h +0 -157
  560. data/ext/pg_query/include/c.h +0 -1391
  561. data/ext/pg_query/include/catalog/catalog.h +0 -44
  562. data/ext/pg_query/include/catalog/catversion.h +0 -58
  563. data/ext/pg_query/include/catalog/dependency.h +0 -269
  564. data/ext/pg_query/include/catalog/genbki.h +0 -142
  565. data/ext/pg_query/include/catalog/index.h +0 -214
  566. data/ext/pg_query/include/catalog/indexing.h +0 -54
  567. data/ext/pg_query/include/catalog/namespace.h +0 -190
  568. data/ext/pg_query/include/catalog/objectaccess.h +0 -265
  569. data/ext/pg_query/include/catalog/objectaddress.h +0 -89
  570. data/ext/pg_query/include/catalog/pg_aggregate.h +0 -180
  571. data/ext/pg_query/include/catalog/pg_aggregate_d.h +0 -78
  572. data/ext/pg_query/include/catalog/pg_am.h +0 -63
  573. data/ext/pg_query/include/catalog/pg_am_d.h +0 -47
  574. data/ext/pg_query/include/catalog/pg_attribute.h +0 -221
  575. data/ext/pg_query/include/catalog/pg_attribute_d.h +0 -62
  576. data/ext/pg_query/include/catalog/pg_authid.h +0 -63
  577. data/ext/pg_query/include/catalog/pg_authid_d.h +0 -57
  578. data/ext/pg_query/include/catalog/pg_class.h +0 -230
  579. data/ext/pg_query/include/catalog/pg_class_d.h +0 -132
  580. data/ext/pg_query/include/catalog/pg_collation.h +0 -98
  581. data/ext/pg_query/include/catalog/pg_collation_d.h +0 -62
  582. data/ext/pg_query/include/catalog/pg_constraint.h +0 -273
  583. data/ext/pg_query/include/catalog/pg_constraint_d.h +0 -73
  584. data/ext/pg_query/include/catalog/pg_control.h +0 -250
  585. data/ext/pg_query/include/catalog/pg_conversion.h +0 -75
  586. data/ext/pg_query/include/catalog/pg_conversion_d.h +0 -38
  587. data/ext/pg_query/include/catalog/pg_depend.h +0 -77
  588. data/ext/pg_query/include/catalog/pg_depend_d.h +0 -36
  589. data/ext/pg_query/include/catalog/pg_event_trigger.h +0 -57
  590. data/ext/pg_query/include/catalog/pg_event_trigger_d.h +0 -36
  591. data/ext/pg_query/include/catalog/pg_index.h +0 -90
  592. data/ext/pg_query/include/catalog/pg_index_d.h +0 -59
  593. data/ext/pg_query/include/catalog/pg_language.h +0 -72
  594. data/ext/pg_query/include/catalog/pg_language_d.h +0 -41
  595. data/ext/pg_query/include/catalog/pg_namespace.h +0 -64
  596. data/ext/pg_query/include/catalog/pg_namespace_d.h +0 -36
  597. data/ext/pg_query/include/catalog/pg_opclass.h +0 -88
  598. data/ext/pg_query/include/catalog/pg_opclass_d.h +0 -51
  599. data/ext/pg_query/include/catalog/pg_operator.h +0 -107
  600. data/ext/pg_query/include/catalog/pg_operator_d.h +0 -142
  601. data/ext/pg_query/include/catalog/pg_opfamily.h +0 -63
  602. data/ext/pg_query/include/catalog/pg_opfamily_d.h +0 -49
  603. data/ext/pg_query/include/catalog/pg_parameter_acl.h +0 -60
  604. data/ext/pg_query/include/catalog/pg_parameter_acl_d.h +0 -34
  605. data/ext/pg_query/include/catalog/pg_partitioned_table.h +0 -74
  606. data/ext/pg_query/include/catalog/pg_partitioned_table_d.h +0 -36
  607. data/ext/pg_query/include/catalog/pg_proc.h +0 -220
  608. data/ext/pg_query/include/catalog/pg_proc_d.h +0 -101
  609. data/ext/pg_query/include/catalog/pg_publication.h +0 -161
  610. data/ext/pg_query/include/catalog/pg_publication_d.h +0 -38
  611. data/ext/pg_query/include/catalog/pg_replication_origin.h +0 -62
  612. data/ext/pg_query/include/catalog/pg_replication_origin_d.h +0 -33
  613. data/ext/pg_query/include/catalog/pg_statistic.h +0 -282
  614. data/ext/pg_query/include/catalog/pg_statistic_d.h +0 -195
  615. data/ext/pg_query/include/catalog/pg_statistic_ext.h +0 -88
  616. data/ext/pg_query/include/catalog/pg_statistic_ext_d.h +0 -45
  617. data/ext/pg_query/include/catalog/pg_transform.h +0 -48
  618. data/ext/pg_query/include/catalog/pg_transform_d.h +0 -34
  619. data/ext/pg_query/include/catalog/pg_trigger.h +0 -153
  620. data/ext/pg_query/include/catalog/pg_trigger_d.h +0 -109
  621. data/ext/pg_query/include/catalog/pg_ts_config.h +0 -53
  622. data/ext/pg_query/include/catalog/pg_ts_config_d.h +0 -34
  623. data/ext/pg_query/include/catalog/pg_ts_dict.h +0 -59
  624. data/ext/pg_query/include/catalog/pg_ts_dict_d.h +0 -35
  625. data/ext/pg_query/include/catalog/pg_ts_parser.h +0 -60
  626. data/ext/pg_query/include/catalog/pg_ts_parser_d.h +0 -37
  627. data/ext/pg_query/include/catalog/pg_ts_template.h +0 -51
  628. data/ext/pg_query/include/catalog/pg_ts_template_d.h +0 -34
  629. data/ext/pg_query/include/catalog/pg_type.h +0 -404
  630. data/ext/pg_query/include/catalog/pg_type_d.h +0 -324
  631. data/ext/pg_query/include/catalog/storage.h +0 -50
  632. data/ext/pg_query/include/commands/async.h +0 -53
  633. data/ext/pg_query/include/commands/dbcommands.h +0 -36
  634. data/ext/pg_query/include/commands/defrem.h +0 -160
  635. data/ext/pg_query/include/commands/event_trigger.h +0 -88
  636. data/ext/pg_query/include/commands/explain.h +0 -127
  637. data/ext/pg_query/include/commands/prepare.h +0 -61
  638. data/ext/pg_query/include/commands/tablespace.h +0 -69
  639. data/ext/pg_query/include/commands/trigger.h +0 -287
  640. data/ext/pg_query/include/commands/user.h +0 -37
  641. data/ext/pg_query/include/commands/vacuum.h +0 -340
  642. data/ext/pg_query/include/commands/variable.h +0 -38
  643. data/ext/pg_query/include/common/file_perm.h +0 -56
  644. data/ext/pg_query/include/common/hashfn.h +0 -104
  645. data/ext/pg_query/include/common/ip.h +0 -31
  646. data/ext/pg_query/include/common/keywords.h +0 -29
  647. data/ext/pg_query/include/common/kwlookup.h +0 -44
  648. data/ext/pg_query/include/common/pg_prng.h +0 -60
  649. data/ext/pg_query/include/common/relpath.h +0 -90
  650. data/ext/pg_query/include/common/string.h +0 -42
  651. data/ext/pg_query/include/common/unicode_combining_table.h +0 -308
  652. data/ext/pg_query/include/common/unicode_east_asian_fw_table.h +0 -125
  653. data/ext/pg_query/include/datatype/timestamp.h +0 -236
  654. data/ext/pg_query/include/executor/execdesc.h +0 -70
  655. data/ext/pg_query/include/executor/executor.h +0 -663
  656. data/ext/pg_query/include/executor/functions.h +0 -55
  657. data/ext/pg_query/include/executor/instrument.h +0 -118
  658. data/ext/pg_query/include/executor/spi.h +0 -213
  659. data/ext/pg_query/include/executor/tablefunc.h +0 -67
  660. data/ext/pg_query/include/executor/tuptable.h +0 -487
  661. data/ext/pg_query/include/fmgr.h +0 -781
  662. data/ext/pg_query/include/funcapi.h +0 -360
  663. data/ext/pg_query/include/getaddrinfo.h +0 -162
  664. data/ext/pg_query/include/jit/jit.h +0 -105
  665. data/ext/pg_query/include/kwlist_d.h +0 -1095
  666. data/ext/pg_query/include/lib/dshash.h +0 -112
  667. data/ext/pg_query/include/lib/ilist.h +0 -746
  668. data/ext/pg_query/include/lib/pairingheap.h +0 -102
  669. data/ext/pg_query/include/lib/simplehash.h +0 -1184
  670. data/ext/pg_query/include/lib/sort_template.h +0 -432
  671. data/ext/pg_query/include/lib/stringinfo.h +0 -161
  672. data/ext/pg_query/include/libpq/auth.h +0 -31
  673. data/ext/pg_query/include/libpq/crypt.h +0 -47
  674. data/ext/pg_query/include/libpq/hba.h +0 -179
  675. data/ext/pg_query/include/libpq/libpq-be.h +0 -343
  676. data/ext/pg_query/include/libpq/libpq.h +0 -144
  677. data/ext/pg_query/include/libpq/pqcomm.h +0 -194
  678. data/ext/pg_query/include/libpq/pqformat.h +0 -210
  679. data/ext/pg_query/include/libpq/pqsignal.h +0 -42
  680. data/ext/pg_query/include/mb/pg_wchar.h +0 -755
  681. data/ext/pg_query/include/mb/stringinfo_mb.h +0 -24
  682. data/ext/pg_query/include/miscadmin.h +0 -495
  683. data/ext/pg_query/include/nodes/bitmapset.h +0 -122
  684. data/ext/pg_query/include/nodes/execnodes.h +0 -2715
  685. data/ext/pg_query/include/nodes/extensible.h +0 -162
  686. data/ext/pg_query/include/nodes/lockoptions.h +0 -61
  687. data/ext/pg_query/include/nodes/makefuncs.h +0 -109
  688. data/ext/pg_query/include/nodes/memnodes.h +0 -110
  689. data/ext/pg_query/include/nodes/nodeFuncs.h +0 -162
  690. data/ext/pg_query/include/nodes/nodes.h +0 -861
  691. data/ext/pg_query/include/nodes/params.h +0 -170
  692. data/ext/pg_query/include/nodes/parsenodes.h +0 -3812
  693. data/ext/pg_query/include/nodes/pathnodes.h +0 -2734
  694. data/ext/pg_query/include/nodes/pg_list.h +0 -612
  695. data/ext/pg_query/include/nodes/plannodes.h +0 -1349
  696. data/ext/pg_query/include/nodes/primnodes.h +0 -1593
  697. data/ext/pg_query/include/nodes/print.h +0 -34
  698. data/ext/pg_query/include/nodes/tidbitmap.h +0 -75
  699. data/ext/pg_query/include/nodes/value.h +0 -80
  700. data/ext/pg_query/include/optimizer/cost.h +0 -213
  701. data/ext/pg_query/include/optimizer/geqo.h +0 -90
  702. data/ext/pg_query/include/optimizer/geqo_gene.h +0 -45
  703. data/ext/pg_query/include/optimizer/optimizer.h +0 -202
  704. data/ext/pg_query/include/optimizer/paths.h +0 -257
  705. data/ext/pg_query/include/optimizer/planmain.h +0 -120
  706. data/ext/pg_query/include/parser/analyze.h +0 -63
  707. data/ext/pg_query/include/parser/gram.h +0 -1101
  708. data/ext/pg_query/include/parser/gramparse.h +0 -75
  709. data/ext/pg_query/include/parser/kwlist.h +0 -487
  710. data/ext/pg_query/include/parser/parse_agg.h +0 -63
  711. data/ext/pg_query/include/parser/parse_coerce.h +0 -100
  712. data/ext/pg_query/include/parser/parse_expr.h +0 -25
  713. data/ext/pg_query/include/parser/parse_func.h +0 -74
  714. data/ext/pg_query/include/parser/parse_node.h +0 -339
  715. data/ext/pg_query/include/parser/parse_oper.h +0 -65
  716. data/ext/pg_query/include/parser/parse_relation.h +0 -124
  717. data/ext/pg_query/include/parser/parse_type.h +0 -60
  718. data/ext/pg_query/include/parser/parser.h +0 -68
  719. data/ext/pg_query/include/parser/parsetree.h +0 -61
  720. data/ext/pg_query/include/parser/scanner.h +0 -152
  721. data/ext/pg_query/include/parser/scansup.h +0 -27
  722. data/ext/pg_query/include/partitioning/partdefs.h +0 -26
  723. data/ext/pg_query/include/pg_config.h +0 -1037
  724. data/ext/pg_query/include/pg_config_manual.h +0 -410
  725. data/ext/pg_query/include/pg_config_os.h +0 -8
  726. data/ext/pg_query/include/pg_getopt.h +0 -56
  727. data/ext/pg_query/include/pg_trace.h +0 -17
  728. data/ext/pg_query/include/pgstat.h +0 -699
  729. data/ext/pg_query/include/pgtime.h +0 -94
  730. data/ext/pg_query/include/pl_gram.h +0 -383
  731. data/ext/pg_query/include/pl_reserved_kwlist.h +0 -52
  732. data/ext/pg_query/include/pl_reserved_kwlist_d.h +0 -114
  733. data/ext/pg_query/include/pl_unreserved_kwlist.h +0 -111
  734. data/ext/pg_query/include/pl_unreserved_kwlist_d.h +0 -244
  735. data/ext/pg_query/include/plerrcodes.h +0 -998
  736. data/ext/pg_query/include/plpgsql.h +0 -1345
  737. data/ext/pg_query/include/port/atomics/arch-arm.h +0 -32
  738. data/ext/pg_query/include/port/atomics/arch-ppc.h +0 -254
  739. data/ext/pg_query/include/port/atomics/arch-x86.h +0 -252
  740. data/ext/pg_query/include/port/atomics/fallback.h +0 -170
  741. data/ext/pg_query/include/port/atomics/generic-gcc.h +0 -286
  742. data/ext/pg_query/include/port/atomics/generic.h +0 -401
  743. data/ext/pg_query/include/port/atomics.h +0 -524
  744. data/ext/pg_query/include/port/pg_bitutils.h +0 -302
  745. data/ext/pg_query/include/port/pg_bswap.h +0 -161
  746. data/ext/pg_query/include/port/pg_crc32c.h +0 -101
  747. data/ext/pg_query/include/port.h +0 -553
  748. data/ext/pg_query/include/portability/instr_time.h +0 -256
  749. data/ext/pg_query/include/postgres.h +0 -808
  750. data/ext/pg_query/include/postgres_ext.h +0 -74
  751. data/ext/pg_query/include/postmaster/autovacuum.h +0 -83
  752. data/ext/pg_query/include/postmaster/auxprocess.h +0 -20
  753. data/ext/pg_query/include/postmaster/bgworker.h +0 -162
  754. data/ext/pg_query/include/postmaster/bgworker_internals.h +0 -64
  755. data/ext/pg_query/include/postmaster/bgwriter.h +0 -45
  756. data/ext/pg_query/include/postmaster/fork_process.h +0 -17
  757. data/ext/pg_query/include/postmaster/interrupt.h +0 -32
  758. data/ext/pg_query/include/postmaster/pgarch.h +0 -73
  759. data/ext/pg_query/include/postmaster/postmaster.h +0 -78
  760. data/ext/pg_query/include/postmaster/startup.h +0 -39
  761. data/ext/pg_query/include/postmaster/syslogger.h +0 -103
  762. data/ext/pg_query/include/postmaster/walwriter.h +0 -21
  763. data/ext/pg_query/include/regex/regex.h +0 -186
  764. data/ext/pg_query/include/replication/logicallauncher.h +0 -29
  765. data/ext/pg_query/include/replication/logicalproto.h +0 -254
  766. data/ext/pg_query/include/replication/logicalworker.h +0 -19
  767. data/ext/pg_query/include/replication/origin.h +0 -73
  768. data/ext/pg_query/include/replication/reorderbuffer.h +0 -685
  769. data/ext/pg_query/include/replication/slot.h +0 -230
  770. data/ext/pg_query/include/replication/syncrep.h +0 -115
  771. data/ext/pg_query/include/replication/walreceiver.h +0 -472
  772. data/ext/pg_query/include/replication/walsender.h +0 -74
  773. data/ext/pg_query/include/rewrite/prs2lock.h +0 -46
  774. data/ext/pg_query/include/rewrite/rewriteHandler.h +0 -38
  775. data/ext/pg_query/include/rewrite/rewriteManip.h +0 -87
  776. data/ext/pg_query/include/rewrite/rewriteSupport.h +0 -26
  777. data/ext/pg_query/include/storage/backendid.h +0 -37
  778. data/ext/pg_query/include/storage/block.h +0 -115
  779. data/ext/pg_query/include/storage/buf.h +0 -46
  780. data/ext/pg_query/include/storage/bufmgr.h +0 -297
  781. data/ext/pg_query/include/storage/bufpage.h +0 -457
  782. data/ext/pg_query/include/storage/condition_variable.h +0 -73
  783. data/ext/pg_query/include/storage/dsm.h +0 -64
  784. data/ext/pg_query/include/storage/dsm_impl.h +0 -76
  785. data/ext/pg_query/include/storage/fd.h +0 -198
  786. data/ext/pg_query/include/storage/fileset.h +0 -40
  787. data/ext/pg_query/include/storage/ipc.h +0 -84
  788. data/ext/pg_query/include/storage/item.h +0 -19
  789. data/ext/pg_query/include/storage/itemid.h +0 -184
  790. data/ext/pg_query/include/storage/itemptr.h +0 -208
  791. data/ext/pg_query/include/storage/large_object.h +0 -100
  792. data/ext/pg_query/include/storage/latch.h +0 -186
  793. data/ext/pg_query/include/storage/lmgr.h +0 -115
  794. data/ext/pg_query/include/storage/lock.h +0 -616
  795. data/ext/pg_query/include/storage/lockdefs.h +0 -59
  796. data/ext/pg_query/include/storage/lwlock.h +0 -206
  797. data/ext/pg_query/include/storage/lwlocknames.h +0 -50
  798. data/ext/pg_query/include/storage/off.h +0 -57
  799. data/ext/pg_query/include/storage/pg_sema.h +0 -61
  800. data/ext/pg_query/include/storage/pg_shmem.h +0 -92
  801. data/ext/pg_query/include/storage/pmsignal.h +0 -105
  802. data/ext/pg_query/include/storage/predicate.h +0 -87
  803. data/ext/pg_query/include/storage/proc.h +0 -461
  804. data/ext/pg_query/include/storage/procarray.h +0 -98
  805. data/ext/pg_query/include/storage/proclist_types.h +0 -51
  806. data/ext/pg_query/include/storage/procsignal.h +0 -71
  807. data/ext/pg_query/include/storage/relfilenode.h +0 -99
  808. data/ext/pg_query/include/storage/s_lock.h +0 -1110
  809. data/ext/pg_query/include/storage/sharedfileset.h +0 -37
  810. data/ext/pg_query/include/storage/shm_mq.h +0 -86
  811. data/ext/pg_query/include/storage/shm_toc.h +0 -58
  812. data/ext/pg_query/include/storage/shmem.h +0 -81
  813. data/ext/pg_query/include/storage/sinval.h +0 -153
  814. data/ext/pg_query/include/storage/sinvaladt.h +0 -43
  815. data/ext/pg_query/include/storage/smgr.h +0 -111
  816. data/ext/pg_query/include/storage/spin.h +0 -77
  817. data/ext/pg_query/include/storage/standby.h +0 -98
  818. data/ext/pg_query/include/storage/standbydefs.h +0 -74
  819. data/ext/pg_query/include/storage/sync.h +0 -66
  820. data/ext/pg_query/include/tcop/cmdtag.h +0 -58
  821. data/ext/pg_query/include/tcop/cmdtaglist.h +0 -218
  822. data/ext/pg_query/include/tcop/deparse_utility.h +0 -108
  823. data/ext/pg_query/include/tcop/dest.h +0 -149
  824. data/ext/pg_query/include/tcop/fastpath.h +0 -20
  825. data/ext/pg_query/include/tcop/pquery.h +0 -51
  826. data/ext/pg_query/include/tcop/tcopprot.h +0 -97
  827. data/ext/pg_query/include/tcop/utility.h +0 -112
  828. data/ext/pg_query/include/tsearch/ts_cache.h +0 -98
  829. data/ext/pg_query/include/utils/acl.h +0 -333
  830. data/ext/pg_query/include/utils/aclchk_internal.h +0 -45
  831. data/ext/pg_query/include/utils/array.h +0 -464
  832. data/ext/pg_query/include/utils/backend_progress.h +0 -44
  833. data/ext/pg_query/include/utils/backend_status.h +0 -321
  834. data/ext/pg_query/include/utils/builtins.h +0 -127
  835. data/ext/pg_query/include/utils/bytea.h +0 -28
  836. data/ext/pg_query/include/utils/catcache.h +0 -231
  837. data/ext/pg_query/include/utils/date.h +0 -90
  838. data/ext/pg_query/include/utils/datetime.h +0 -344
  839. data/ext/pg_query/include/utils/datum.h +0 -76
  840. data/ext/pg_query/include/utils/dsa.h +0 -123
  841. data/ext/pg_query/include/utils/dynahash.h +0 -20
  842. data/ext/pg_query/include/utils/elog.h +0 -470
  843. data/ext/pg_query/include/utils/errcodes.h +0 -354
  844. data/ext/pg_query/include/utils/expandeddatum.h +0 -159
  845. data/ext/pg_query/include/utils/expandedrecord.h +0 -231
  846. data/ext/pg_query/include/utils/float.h +0 -356
  847. data/ext/pg_query/include/utils/fmgroids.h +0 -3261
  848. data/ext/pg_query/include/utils/fmgrprotos.h +0 -2829
  849. data/ext/pg_query/include/utils/fmgrtab.h +0 -49
  850. data/ext/pg_query/include/utils/guc.h +0 -469
  851. data/ext/pg_query/include/utils/guc_tables.h +0 -276
  852. data/ext/pg_query/include/utils/hsearch.h +0 -153
  853. data/ext/pg_query/include/utils/inval.h +0 -68
  854. data/ext/pg_query/include/utils/lsyscache.h +0 -208
  855. data/ext/pg_query/include/utils/memdebug.h +0 -82
  856. data/ext/pg_query/include/utils/memutils.h +0 -230
  857. data/ext/pg_query/include/utils/numeric.h +0 -90
  858. data/ext/pg_query/include/utils/palloc.h +0 -158
  859. data/ext/pg_query/include/utils/partcache.h +0 -102
  860. data/ext/pg_query/include/utils/pg_locale.h +0 -127
  861. data/ext/pg_query/include/utils/pg_lsn.h +0 -29
  862. data/ext/pg_query/include/utils/pgstat_internal.h +0 -784
  863. data/ext/pg_query/include/utils/pidfile.h +0 -56
  864. data/ext/pg_query/include/utils/plancache.h +0 -236
  865. data/ext/pg_query/include/utils/portal.h +0 -252
  866. data/ext/pg_query/include/utils/probes.h +0 -114
  867. data/ext/pg_query/include/utils/ps_status.h +0 -25
  868. data/ext/pg_query/include/utils/queryenvironment.h +0 -74
  869. data/ext/pg_query/include/utils/queryjumble.h +0 -88
  870. data/ext/pg_query/include/utils/regproc.h +0 -39
  871. data/ext/pg_query/include/utils/rel.h +0 -695
  872. data/ext/pg_query/include/utils/relcache.h +0 -153
  873. data/ext/pg_query/include/utils/reltrigger.h +0 -81
  874. data/ext/pg_query/include/utils/resowner.h +0 -86
  875. data/ext/pg_query/include/utils/rls.h +0 -50
  876. data/ext/pg_query/include/utils/ruleutils.h +0 -47
  877. data/ext/pg_query/include/utils/sharedtuplestore.h +0 -61
  878. data/ext/pg_query/include/utils/snapmgr.h +0 -179
  879. data/ext/pg_query/include/utils/snapshot.h +0 -219
  880. data/ext/pg_query/include/utils/sortsupport.h +0 -391
  881. data/ext/pg_query/include/utils/syscache.h +0 -224
  882. data/ext/pg_query/include/utils/timeout.h +0 -95
  883. data/ext/pg_query/include/utils/timestamp.h +0 -117
  884. data/ext/pg_query/include/utils/tuplesort.h +0 -291
  885. data/ext/pg_query/include/utils/tuplestore.h +0 -91
  886. data/ext/pg_query/include/utils/typcache.h +0 -209
  887. data/ext/pg_query/include/utils/tzparser.h +0 -39
  888. data/ext/pg_query/include/utils/varlena.h +0 -41
  889. data/ext/pg_query/include/utils/wait_event.h +0 -289
  890. data/ext/pg_query/include/utils/xml.h +0 -84
  891. data/ext/pg_query/src_backend_postmaster_postmaster.c +0 -2201
  892. data/ext/pg_query/src_backend_storage_lmgr_s_lock.c +0 -371
  893. data/ext/pg_query/src_backend_utils_hash_dynahash.c +0 -1116
  894. data/ext/pg_query/src_backend_utils_misc_guc.c +0 -1993
  895. data/ext/pg_query/src_common_pg_prng.c +0 -152
  896. data/ext/pg_query/src_common_string.c +0 -92
  897. data/ext/pg_query/src_port_pgsleep.c +0 -69
  898. data/ext/pg_query/src_port_strnlen.c +0 -39
  899. /data/ext/pg_query/{pg_query_ruby.sym → ext_symbols.sym} +0 -0
  900. /data/ext/pg_query/include/{access → postgres/access}/rmgr.h +0 -0
  901. /data/ext/pg_query/include/{pg_config_ext.h → postgres/pg_config_ext.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-2024, 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));