Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Postgres function result record
create function fun42(a integer, b integer, OUT c bigint, OUT d character varying)
returns record
language plpgsql
as $$
begin
c = a + b;
d = c::varchar;
end;
$$;
do $$
declare
x record;
begin
x = fun42(a := 1, b := 2);
raise notice 'c = %', x.c;
raise notice 'd = %', x.d;
end$$;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment