> scatdepth integer DEFAULT (SELECT scatval from scattab where scatval =
> scatscat) + 1,
I think you mean "(SELECT scatdepth from scattab where scatval = scatscat)
+ 1" . (Perhaps you might consider calling scatscat "scatparent" instead.)
How about defining a function and setting the default to its return value?
-Z-