pg_query 2.0.3 → 5.1.0

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