Add read support for some missing raw parse nodes
authorPeter Eisentraut <[email protected]>
Sat, 24 Sep 2022 22:18:33 +0000 (18:18 -0400)
committerPeter Eisentraut <[email protected]>
Sat, 24 Sep 2022 22:18:33 +0000 (18:18 -0400)
commita6bc3301925e1a8ad1f58da629b9dd55bc4b8d9c
tree1d4edc9f60cb0a144931caff3de6f9797d77fe9e
parent2cb1a5a8d4aeb63da2d6a2d22169f05c60bb5828
Add read support for some missing raw parse nodes

The node types A_Const, Constraint, and A_Expr had custom output
functions, but no read functions were implemented so far.

The A_Expr output format had to be tweaked a bit to make it easier to
parse.

Be a bit more cautious about applying strncmp to unterminated strings.

Also error out if an unrecognized enum value is found in each case,
instead of just printing a placeholder value.  That was maybe ok for
debugging but won't work if we want to have robust round-tripping.

Reviewed-by: Tom Lane <[email protected]>
Discussion: https://www.postgresql.org/message-id/flat/4159834.1657405226@sss.pgh.pa.us
src/backend/nodes/outfuncs.c
src/backend/nodes/readfuncs.c
src/include/nodes/parsenodes.h