OK, I see it is the term open which fails the syntax checker - I guessed this might be because open is a reserved word but http://www.postgresql.org/docs/9.0/interactive/sql-keywords-appendix.html does not indicate whether open is either reserved or not in postgresql.
Checking 8.4 doco, http://www.postgresql.org/docs/8.4/static/sql-keywords-appendix.html has the same detail when it comes to 'reservedness' of the term open.
Still interested in a definitive answer, but the fix for me appears to be simply to change the word open to something else.