"unterminated dollar-quoted string" error when creating plpgsql function with an empty string as default parameter value
dbForge Studio Express for PostgreSQL 1.0.410.
PostgreSQL 10.3 on x8664-alt-linux-gnu, compiled by x8664-alt-linux-gcc (GCC) 5.3.1 20151207 (ALT Linux 5.3.1-alt3), 64-bit
"Unterminated dollar-quoted string" error raises when creating plpgsql function with an empty string as default parameter value.
Repro:
execute this script in dbForge Studio:
create or replace function dbo.test123
(
p text = ''
)
returns void
as
$$
declare
begin
null;
end;
$$
language plpgsql;
output:
------ Execution started: Connection: SQL.sql ------
Error (1,1): unterminated dollar-quoted string at or near "$$
declare
begin
null"
DML succeeded [0,005s]
Error (12,1): unterminated dollar-quoted string at or near "$$
language plpgsql"
------------ Done: SQL.sql -------------
