pgschema
pgschema copied to clipboard
Procedures argument modes are ignored when dumping
Continuing with #59 we've found that procedure argument arg_modes are not dumped. Here's an example:
CREATE OR REPLACE PROCEDURE example_procedure(IN input_value integer, OUT output_value integer)
LANGUAGE plpgsql
AS $$
BEGIN
-- Example procedure that takes an integer input
RAISE NOTICE 'Input value is: %', input_value;
output_value := input_value + 1;
END;
$$;
-- example usage
DO $$
DECLARE
input integer := 42;
result integer;
BEGIN
CALL example_procedure(input, result);
RAISE NOTICE 'Result is: %', result;
END;
$$;
and the output we get from pgschema dump is:
--
-- pgschema database dump
--
-- Dumped from database version PostgreSQL 17.0
-- Dumped by pgschema version 1.2.1
--
-- Name: example_procedure; Type: PROCEDURE; Schema: -; Owner: -
--
CREATE OR REPLACE PROCEDURE example_procedure(
input_value integer,
output_value integer
)
LANGUAGE plpgsql
AS $$
BEGIN
-- Example procedure that takes an integer input
RAISE NOTICE 'Input value is: %', input_value;
output_value := input_value + 1;
END;
$$;
When you reinstall the procedure using pgschema's version you get an error:
DO $$
DECLARE
input integer := 42;
result integer;
BEGIN
CALL example_procedure(input, result);
RAISE NOTICE 'Result is: %', result;
END;
$$;
--- NOTICE: Input value is: 42
--- NOTICE: Result is: <NULL>
tested this change and it works great! thanks! 👍