pgadmin4
pgadmin4 copied to clipboard
procedure returns different result when directly executed on DB server vs debugged through debugger(pgAdmin/PEM)
Procedure code :
-- Package: public.empinfo
-- DROP PACKAGE public.empinfo;
CREATE OR REPLACE PACKAGE public.empinfo
IS
mv_num numeric(4,0);
PROCEDURE p_execute(jigyosyocode character(8)); -- OR PROCEDURE p_execute(jigyosyocode character);
END empinfo;
CREATE OR REPLACE PACKAGE BODY public.empinfo
IS
PROCEDURE p_execute(jigyosyocode character(8)) -- OR PROCEDURE p_execute(jigyosyocode character);
IS
BEGIN
mv_num := 1000;
RAISE INFO 'テスト';
-- COMMIT;
EXCEPTION
WHEN OTHERS THEN
ROLLBACK;
-- 例外を再スロー
RAISE;
END p_execute;
END empinfo;
When p_execute directly executed on DB server then result is as below :
edb=# select * from empinfo.p_Execute('kishor');
INFO: テスト
INFO: kishor
p_execute
-----------
(1 row)
edb=#
When p_execute executed (empinfo.p_Execute(‘kishor’)) using debugger (pgAdmin/PEM) result is as below :
INFO: テスト
INFO: k
EDB-SPL Procedure successfully completed
Based on the above example, Its appears that, when the procedure is directly executed on DB server it accpets any length of value in parameter jigyosyocode (with datatype character(8) or character ). However, when the procedure is attached to the debugger (in PEM/PgADMin) then parameter jigyosyocode(with datatype character(8) or character) accepts only a single character.
So the behavior of the datatype character when used with procedure arguments looks incorrect when procedure is executed with debugger.
Thank you.