How to detect if any rows were returned in plpgsql function? - Mailing list pgsql-novice

From A B
Subject How to detect if any rows were returned in plpgsql function?
Date
Msg-id AANLkTi=iJpu2==szfF-OnUzSXqiCEw=zOQhDdMOFW5qw@mail.gmail.com
Whole thread Raw
List pgsql-novice
Hello.

If I write two functions (with appologies for any syntax error)


create function bar() returns set of integer language plpgsql as $$
begin
  return query select something.....;
end; $$;

create function foo() returns set of integer language plpgsql as $$
begin
  return query select * from bar();
end; $$;


how can I before the function foo ends, check if I got any data back
from the call to bar() ?

pgsql-novice by date:

Previous
From: Michael Rau
Date:
Subject: Re: ALTER DEFAULT PRIVs / not working for me
Next
From: Majid Azimi
Date:
Subject: Actual Table Data