Please consider integrating PostgreSQL specific syntax coloring for editing SQL. This capability is already implemented in the Ace editor which is designed to be embedded in HTML applications. See
To try the live demo, just select "pgSQL" from the Document menu:
The current implementation supports SQL, pl/pgsql, pl/perl, and pl/python.