Open edigonzales opened 6 years ago
That's not a bug, that's a feature...
Because the $
is used a param start character, you have to duplicate it, if you want to have a $
in your sql text. (Any character other than {
should also work)
Use dollar quoting with a tag (https://www.postgresql.org/docs/current/static/sql-syntax-lexical.html#SQL-SYNTAX-DOLLAR-QUOTING).
Aaah, the problem is actually not the the dollar but the semicolon in my sql:
CREATE OR REPLACE FUNCTION fubar RETURNS double precision AS
$function$
DECLARE
x0 DOUBLE PRECISION;
y0 DOUBLE PRECISION;
....
ehisqlgen assumes (I guess) that the sql statement ends after first semicolon.
CREATE OR REPLACE FUNCTION ${schema_name}.interpolateZValue(p geometry, p0 geometry, p1 geometry, p2 geometry) RETURNS double precision AS $$
BEGIN
return 0.0
END;
$$ LANGUAGE plpgsql;
Does not work since it removes one dollar sign for substituting ${schema_name}. Ugly workaround: use single quote style. -> fix sql parameter substitution in gretl (e.g. ignore 2 following dollar signs)