Josh Berkus <josh(at)agliodbs(dot)com> writes:
> What about table-level check constraints? Seems like one of those should be
> able to be used to check a vertical assertion within a table. Or do we need
> SQL ASSERTION for this?
Seems like it would be smart to maintain a syntactic distinction between
row-local checks and global checks, so I'd be inclined to insist on
using ASSERTION. I am not sure what the SQL spec has to say about this
though --- they probably have some obscure phraseology that bears on the
question.
AFAIR, whether a constraint is syntactically attached to a column or is
"loose" in the table definition is not supposed to have any semantic
consequences, but I might be wrong about that too.
regards, tom lane