Postgresql : with clause function

1.4k Views Asked by At

does PostgreSQL support function in with Clause? oracle has the functionality as below

WITH
  function add_fnc(p_id number) return number
  is
  begin
    return p_id + 1; 
  end;
select add_fnc(id1) from test_tbl;
1

There are 1 best solutions below

0
On BEST ANSWER

There is no such thing as CTE functions in PostgreSQL (as cofemann noted), but it seems what you are looking for are temporary functions. Take a look How to create a temporary function in PostgreSQL?