From: | "Yonatan Ben-Nes" <da(at)canaan(dot)co(dot)il> |
---|---|
To: | <pgsql-general(at)postgresql(dot)org> |
Subject: | Functions just dont want to work! [hard] |
Date: | 2002-12-04 18:32:34 |
Message-ID: | 013901c29bc3$836c8350$aa0f5ac2@canaan.co.il |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Hi,
I'm having a problem at a code which worked already and now after installing the new postgresql version it doesn't work (i didnt check it actually for about 2-3 months but i didnt change anything in the meanwhile).
the problem occur only with functions which i created and the error which it gives me is (all of the functions get the same error) -
Warning: PostgreSQL query failed: ERROR: Function insert_new_field(integer, "unknown", "unknown") does not exist Unable to identify a function that satisfies the given argument types You may need to add explicit typecasts.
now i echoed the sql line itself and its -
SELECT insert_new_field(24, '2', '2');
while the function code itself is -
CREATE FUNCTION public.insert_new_field(int2, text, text) RETURNS text AS '
DECLARE
v_prod_id ALIAS FOR $1;
v_property ALIAS FOR $2;
v_value ALIAS FOR $3;
row_data fields%ROWTYPE;
BEGIN
FOR row_data IN SELECT * FROM fields WHERE prod_id = v_prod_id LOOP
IF row_data.property = v_property THEN
RAISE EXCEPTION ''Error: This property already exist at the DB'';
END IF;
END LOOP;
INSERT INTO fields (prod_id, property, value)
VALUES (v_prod_id, v_property, v_value);
RETURN ''Done'';
END;' LANGUAGE 'plpgsql' VOLATILE;
btw what's that volatile? and y it added to my function name "public." at her start name (i did tried to call the function with adding that name without any diffrent error)
can anyone help me here?
thx in advance
Yonatan
-----
"My friends worth gold to me, so i prefer to sell them and get rich!"
Ben-Nes Yonatan
Canaan Surfing Ltd.
http://sites.canaan.co.il/index.phtml
From | Date | Subject | |
---|---|---|---|
Next Message | Jean-Luc Lachance | 2002-12-04 18:39:52 | Re: Efficient Boolean Storage |
Previous Message | Bruce Momjian | 2002-12-04 18:28:50 | Re: 7.3 no longer using indexes for LIKE queries |