That I want to ask is if I can return type A or B in the function depending of a parameter. For example



CREATE or replace FUNCTION public.getDataF romSearch(
searchString VARCHAR,
typeOperation INTEGER)
RETURNS SETOF typeA OR typeB AS ...

If typeOperation is 'A' can I return a query with the structure or typeA and if is 'B' the second type ?