GoldPaintedLemons
GoldPaintedLemons

Reputation: 492

type casted call to postgres stored procedure not matching

I created a stored procedure via pgAdmin, logged in as 'postgres' (the only user, and an admin):

CREATE OR REPLACE PROCEDURE public."spCreateMeet"(
    "_MeetName" character varying,
    "_MeetBannerDescription" character varying,
    "_MeetDate" date)
LANGUAGE 'sql'
AS $BODY$
INSERT INTO public."tblMeet"
("MeetName", "MeetBannerDescription", "MeetDate")
VALUES ("_MeetName", "_MeetBannerDescription", "_MeetDate")
RETURNING "MeetId";
$BODY$;

Here's my call, being made directly in pgAdmin, logged in as same user that created it:

CALL spCreateMeet('TestMeet'::character varying,'blah'::character varying,'2021-06-01T00:00:00.000Z'::date)

It is properly type cast, and I've tried qualifying with 'public.', so why am I getting:

ERROR:  procedure spcreatemeet(character varying, character varying, date) does not exist

LINE 1: CALL spCreateMeet('TestMeet'::character varying,'blah...
             ^

HINT:  No procedure matches the given name and argument types. You might need to add explicit type casts.

Upvotes: 0

Views: 1822

Answers (1)

Akhilesh Mishra
Akhilesh Mishra

Reputation: 6130

First of all don't use upper case or camel case in column, table, function etc. names in postgresql because it is case sensitive. If you do that then it will create a problem every time.

you can see the error where it is showing the procedure name in small case. If you will not surround the names with double quote then it will treat it as small case only so the solution is surround the names with double quote.

Try this:

CALL "spCreateMeet"('TestMeet'::character varying,'blah'::character varying,'2021-06-01T00:00:00.000Z'::date)

Upvotes: 1

Related Questions