In the below postgres function I am passing 'sample' (integer) as an input parma but when I try to print it's value using raise notice inside the function body I get the following error
ERROR: column "sample" does not exist LINE 1: SELECT sample
CREATE OR REPLACE FUNCTION public.test_function(
sample integer)
RETURNS json
LANGUAGE 'sql'
COST 100
VOLATILE PARALLEL UNSAFE
AS $BODY$
DO $$
BEGIN
raise notice 'test: %',sample;
END
$$;
select json_agg(1);
$BODY$;
select "test_function"(10);