When I run the following create statement I get the error syntax error at or near "when." I tried commenting out sections to figure out which one is causing it but it seem that they all have the same syntax error. I am new to postgreSQL, so I may have more than that wrong with this create statement.When I run the following create statement I get