I'm new to PostgreSQL, and trying to learn about stored procedure with PostgreSQL. Here are the steps I followed.
- Installed pgAdmin4
- Created the Database
- Created the table "Users" under public schema
- Created the procedure "GetUserByEmail"
CREATE OR REPLACE PROCEDURE GetUserByEmail
(
Email Varchar(100)
)
LANGUAGE plpgsql AS
$$
BEGIN
Select * from public."Users" where "Email" = Email
END
$$;
When calling it from query tool, I get an error.
CALL public.GetUserByEmail('d@d.com')
ERROR: procedure public.getuserbyemail(unknown) does not exist LINE 1: CALL public.GetUserByEmail('d@d.com')
^ HINT: No procedure matches the given name and argument types. You might need to add explicit type casts. SQL state: 42883 Character: 6
Checked the permission, and the user has execution rights.
Tried different ways but not sure what is wrong.