Hello,
FreeBSD, I386, Postgres 8.0.0 beta2
Trying issuing such a plpgsql function:
Create function test_fun (suffix char(4)) returns integer as $$
DECLARE
sql text;
BEGIN
sql := 'insert into tbl' || suffix::text || ' values (1,1)';
EXECUTE sql;
IF NOT FOUND THEN
RAISE NOTICE 'NOT INSERTED';
END IF;
return 1;
END;
$$ LANGUAGE plpgsql;
create table tbl_a (id integer,name integer);
db# select test_fun('_a');
NOTICE: NOT INSERTED
test_fun
----------
1
(1 row)
db# # select * from tbl_a;
id | name
----+------
1 | 1
(1 row)
When I trying monitoring the result with GET DIAGNOSTICS - all fine, but
with FOUND it doesn't work.
Thank You in advance.
Konstantin