| PG's documentation shows CREATE FUNCTION samples that use
a "dollar quoting" to avoid the nested single quotes
e.g. http://www.postgresql.org/docs/8.0/static/plpgsql-structure.html
But the JDBC driver does not (yet) understand this - this
seems to be only implemented in the psql command line tool.
So we'll replace the "dollar quotes" with regular single quotes
Every single quote inside the function body will be replaced with
two single quotes to properly "escape" them.
This does not mimic psql's quoting completely as basically
you can also use some descriptive words between the dollar signs, such
as $body$ which will not be detected by this method.
|