fixed some of the SQL formatting.  Looking good.  The create statements test OK when run manually into postrgres.  Need to check on the trigger.  Also discovered that logger formatting does not work the way I thought.  So need to change some of that.