Merge the Constraint and FkConstraint node types into a single type.
Tom Lane <tgl@sss.pgh.pa.us>
Merge the Constraint and FkConstraint node types into a single type. This was foreseen to be a good idea long ago, but nobody had got round to doing it. The recent patch for deferred unique constraints made transformConstraintAttrs() ugly enough that I decided it was time. This change will also greatly simplify parsing of deferred CHECK constraints, if anyone ever gets around to implementing that. While at it, add a location field to Constraint, and use that to provide an error cursor for some of the constraint-related error messages.
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/catalog/heap.c | modified | +3 −3 |
| src/backend/commands/tablecmds.c | modified | +68 −80 |
| src/backend/commands/trigger.c | modified | +6 −4 |
| src/backend/commands/typecmds.c | modified | +25 −31 |
| src/backend/nodes/copyfuncs.c | modified | +12 −26 |
| src/backend/nodes/equalfuncs.c | modified | +12 −24 |
| src/backend/nodes/nodeFuncs.c | modified | +4 −1 |
| src/backend/nodes/outfuncs.c | modified | +48 −37 |
| src/backend/parser/gram.y | modified | +32 −87 |
| src/backend/parser/parse_utilcmd.c | modified | +132 −165 |
| src/include/nodes/nodes.h | modified | +1 −2 |
| src/include/nodes/parsenodes.h | modified | +44 −48 |