Thread: Re: volatile void returning function not executed as often as expected in sql function

When I send the mail, I saw it, the problem is that the function
should return setof void instead of void, then it works, sorry for
bothering.

pv=# --increase every a in foo by 1, but now in function
create or replace function foofunc2() returns setof void as
$func$
    select foofunc(a) from foo
$func$ language sql;


pv=# select foofunc2();
 foofunc2
----------



(3 rows)

pv=# select * from foo;
  a
-----
   1
  11
 101
(3 rows)


On Wed, May 15, 2013 at 5:44 AM, Ingmar Brouns <swingi@gmail.com> wrote:
> When I send the mail, I saw it, the problem is that the function
> should return setof void instead of void, then it works, sorry for
> bothering.

for non-trivial sql language processing functions I tend to return an
error code or string indicating success.

create or replace function foofunc2() returns int as
$func$
    select foofunc(a) from foo;
    select 0;
$func$ language sql;