diff options
author | Peter Eisentraut <peter@eisentraut.org> | 2022-09-24 18:18:33 -0400 |
---|---|---|
committer | Peter Eisentraut <peter@eisentraut.org> | 2022-09-24 18:18:33 -0400 |
commit | a6bc3301925e1a8ad1f58da629b9dd55bc4b8d9c (patch) | |
tree | 1d4edc9f60cb0a144931caff3de6f9797d77fe9e /src/include/nodes/parsenodes.h | |
parent | 2cb1a5a8d4aeb63da2d6a2d22169f05c60bb5828 (diff) | |
download | postgresql-a6bc3301925e1a8ad1f58da629b9dd55bc4b8d9c.tar.gz postgresql-a6bc3301925e1a8ad1f58da629b9dd55bc4b8d9c.zip |
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 <tgl@sss.pgh.pa.us>
Discussion: https://www.postgresql.org/message-id/flat/4159834.1657405226@sss.pgh.pa.us
Diffstat (limited to 'src/include/nodes/parsenodes.h')
-rw-r--r-- | src/include/nodes/parsenodes.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/include/nodes/parsenodes.h b/src/include/nodes/parsenodes.h index 6958306a7dc..aead2afd6ef 100644 --- a/src/include/nodes/parsenodes.h +++ b/src/include/nodes/parsenodes.h @@ -291,7 +291,7 @@ typedef enum A_Expr_Kind typedef struct A_Expr { - pg_node_attr(custom_read_write, no_read) + pg_node_attr(custom_read_write) NodeTag type; A_Expr_Kind kind; /* see above */ @@ -319,7 +319,7 @@ union ValUnion typedef struct A_Const { - pg_node_attr(custom_copy_equal, custom_read_write, no_read) + pg_node_attr(custom_copy_equal, custom_read_write) NodeTag type; union ValUnion val; @@ -2332,7 +2332,7 @@ typedef enum ConstrType /* types of constraints */ typedef struct Constraint { - pg_node_attr(custom_read_write, no_read) + pg_node_attr(custom_read_write) NodeTag type; ConstrType contype; /* see above */ |