Segregated the problematic portion, and showing for your view here.,
1. Following is the function definition,
Code:
create or replace function new_del(id integer) returns void as $$
begin
raise info 'dollar :%',$1;
delete from testing where id=$1;
end ;
$$
language 'plpgsql';
2. following is the table "testing" contains,
Code:
SELECT * from testing ;
id
-----
101
102
103
(3 rows)
3. When i call the function as
Code:
SELECT new_del('101');
INFO: dollar :101
new_del
---------
(1 row)
It deletes all the rows ! Why it is doing like this !
4. But when i change the name of the argument then the function behaves normally.
I changed the argument name "id" to id_field it behaved normally and deletes only the specified row.
Any help is appreciated.