pcj127
04/03/2022, 10:06 PMnewstr := fmt.Sprintf("%s-%s", "foo", "bar")
This has been surprisingly difficult to google.tourdownunder
04/03/2022, 10:10 PMpcj127
04/03/2022, 10:10 PMCREATE OR REPLACE FUNCTION str_cat(
a text,
b text)
RETURNS text
AS $$
declare
out text;
begin
out := a || b;
out := a || '-' || b;
out := format('%s | %s', a, b);
return out;
END;
$$ LANGUAGE plpgsql;
tourdownunder
04/03/2022, 10:15 PMout
would do anything.
I'd look up out
to check that it is a reserved word if your having any odd issues.
https://www.postgresql.org/docs/current/sql-keywords-appendix.html