Stored Procedure inout parameter value not being set

22 views
Skip to first unread message

Curtis Bradley

unread,
Jun 8, 2021, 4:37:49 PM6/8/21
to pgTAP Users
== pgTAP

-- The follow runs but fails.
\set payload '\'{"foo":"bar"}\''
\set result '\'well well\''
\set expectedResult '\'{"cheese": "good stuff!"}\''

call doit(:payload::json, :result::text);

SELECT matches (:result::text, :expectedResult::text, 'as expected!');

-- the output:
not ok 3 - as expected!
# Failed test 3: "as expected!"
#                   'well well'
#    doesn't match: '{"cheese": "good stuff!"}'
# Looks like you failed 1 test of 3
Failed 1/3 subtests 

When I call the PL/pgSQL Stored Procedure from psql or pgAdmin, the parameter 'result' contains the value in 'expectedResult' after the call completes.

Questions:
- Am I correctly passing the INOUT parameter 'result'?
- Am I correctly reading the INOUT parameter 'result' after the call completes?
- Am I doing something else wrong?

Thanks!
Reply all
Reply to author
Forward
0 new messages