pldebugger
pldebugger copied to clipboard
Discrepancy in passing default values to procedures in the debugger
Hello.
This could be a bug in pgAdmin or a bug in a pldebugger. I am not entirely sure.
In either case I am posting it on both projects' issues pages.
Procedure
create or replace procedure issue_pldebugger(
in param text default 'silly')
language 'plpgsql' as $$
declare
var text;
begin
select format('Param''s literal value is "%L" and string value is "%s"', param, param) into var;
raise notice '%', var;
end $$;
Called from psql
Called, using call issue_pldebugger(); gives the following:
NOTICE: Param's literal value is "'silly'" and string value is "silly"
CALL
Calling using the debugger
Leave the default value checkbox marked as seen below:
In this case we get this output:
NOTICE: Param's literal value is "'''silly''::text'" and string value is "'silly'::text"
CALL
Namely, the entire thing 'silly'::text is passed as a string!
This is easily rectified by unchecking the default value checkbox and entering the default string value as just 'silly':
In which case we get the expected output:
NOTICE: Param's literal value is "'silly'" and string value is "silly"
CALL