I'm trying to create a function that dynamically changes the password for a client but I get an error "ERROR: syntax error at or near "=" ALTER USER postgres WITH PASSWORD = '$1';"
How do I fix this? Thank you for your time
CREATE OR REPLACE FUNCTION public."Change_password"(
password character varying)
RETURNS void
LANGUAGE 'plpgsql'
COST 100
VOLATILE PARALLEL UNSAFE
AS $BODY$
BEGIN
ALTER USER postgres WITH PASSWORD= '$1';
END
$BODY$;
ALTER FUNCTION public."Change_password"(character varying)
OWNER TO postgres;
SELECT public."Change_password"(
'10'
)