Claudio Freire <klaussfreire@gmail.com> writes:
> What about something more generic?
> CREATE TABLE <tname> ( <cname> <type> [(<expr>)] REFERENCES <t2name>
> [(<t2expr>)] )
> Meaning, if <expr> is missing, it's taken <expr> = <cname>, if not,
> it's the result of that expression the one that references the target
> table.
Doesn't seem terribly sensible as a column constraint: a column
constraint ought to just be on the current column. If you want
something more generic, the table-constraint syntax would be the
place for it ... but that's not where we have a syntax problem.
regards, tom lane