Please find attached a patch to take 'make check' code-coverage of SCHEMA from 33% to 98%.
Any feedback is more than welcome.
p.s.: I am currently working on more regression tests (USER / VIEW / DISCARD etc). Please let me know if I need to post these as one large patch, instead of submitting one patch at a time.