postgresql - How could I return a varchar message in Postgres as part of function return table that isn't in any table? -
i need return message (a different message according evaluations inside de function), when call function returns error message: "returned type unknown not match expected type character varying in column 2".
create or replace function myfunction()returns table( cod integer, answ character varying ) $body$ begin return query select 0, 'here goes message'; end; $body$ language plpgsql;
try:
create or replace function myfunction()returns table( cod integer, answ character varying ) $body$ begin return query select 0, 'here goes message'::character varying; end; $body$ language plpgsql;
Comments
Post a Comment