Created
October 23, 2017 14:36
-
-
Save leo-from-spb/0a215163ddd8db3d3ce38168628f996f to your computer and use it in GitHub Desktop.
Postgres function result record
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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