|< < 42 > >|

Postgres Stored Procedures

A function can return a table

Example: Write a function that returns all accounts with balances > 100

Solution 2: Return a query result
create function rich_accounts() returns setof account as $$ begin return query select * from account where acct.balance > 100; end $$ language plpgsql;

|< < 42 > >|