create table tez (i int);
insert into tez values(3);
create function tezt0(int) returns int as '
begin work;
lock table tez;
select * from tez as r;
commit work;
select tez.i;
' language 'sql';
select tezt0(1);
tezt0
-------
3
(1 row)
create function tezt1(int) returns timestamp as '
begin work;
lock table tez;
select now() as n;
commit work;
select n;
' language 'sql';
ERROR: Attribute 'n' not found
ok so it's a visibility error in my instance here but how can i get the
value returned from a function inside the transaction
a wrapper like this is the only way I can see to lock tables a 'plpgsql'
function updates.
"Functions and trigger procedures are always executed within a transaction
established by an outer query"
so how on earth do i do this and find out what my functions return!
TIA
Matt