]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
Fix _outConstraint() for "identity" constraints
authorPeter Eisentraut <peter@eisentraut.org>
Fri, 12 Aug 2022 06:17:30 +0000 (08:17 +0200)
committerPeter Eisentraut <peter@eisentraut.org>
Fri, 12 Aug 2022 06:52:14 +0000 (08:52 +0200)
The set of fields printed by _outConstraint() in the CONSTR_IDENTITY
case didn't match the set of fields actually used in that case.  (The
code was probably uncarefully copied from the CONSTR_DEFAULT case.)
Fix that by using the right set of fields.  Since there is no read
support for this node type, this is really just for debugging output
right now, so it doesn't affect anything important.

src/backend/nodes/outfuncs.c

index 0c0b4f64fb4664e7517c214a2cc6598abbb659c4..71a3acf2d76d3a7a7a33df3143af088a817919c6 100644 (file)
@@ -3469,8 +3469,7 @@ _outConstraint(StringInfo str, const Constraint *node)
 
                case CONSTR_IDENTITY:
                        appendStringInfoString(str, "IDENTITY");
-                       WRITE_NODE_FIELD(raw_expr);
-                       WRITE_STRING_FIELD(cooked_expr);
+                       WRITE_NODE_FIELD(options);
                        WRITE_CHAR_FIELD(generated_when);
                        break;