Probably in the situation where the sum types have actual payloads, instead of being simple enums. For example, if it was
type SHAPE = NONE | SQUARE(w, h INTEGER) | CIRCLE(r INTEGER) | TRIANGLE(a, b, c INTEGER) | BLOB(e SVG_STRING)
In my solution it entails having
TABLE WithShapeNone(...)
TABLE WithShapeSquare(..., w, h INTEGER)
TABLE WithShapeCircle(..., r INTEGER)
TABLE WithShapeTriangle(..., a, b, c INTEGER)
TABLE WithShapeBlob(..., e SVG_STRING)
It seems I can't easily generalize your solution, so I won't strawman it.
Then again, I think the proper solution would just be adding the sum types into the system. We could have "+" implemented as a 3-column table too, but why would we?
Your notice of "only values can be parametrized. Identifiers can not" in the sibling comment is exactly what I was trying to express in these threads: the relational model is first-order, not second-order, so while you can theoretically model everything with it (logician have done it), it's ugly and impractical without some extensions. Better types for "ground" values is one such extension.