On Friday, January 26, 2018, Garry Chen <
gc92@cornell.edu> wrote:
Hi All,
I have a working function that returns setoff record was created under porstgresql 9.6 but when I try to create the same function under release 10 it gives me error type”recode” does not exist. Therefore, I changed it to RETURNS SETOF table_name.column%varachar(7) I got syntax error. Can anyone let me know the right syntax?
AFAIK there is nothing changed between 9.6 and 10 that should affect this. Providing the complete create function statement (you can probably replace the body string with raise notice or something similar) would be helpful, but "recode" is an odd, and custom, type name...
As for the spec using "%", the point of it is to infer the data type from the named column, which means you shouldn't actually have a data type name (i.e., varchar) in the expression. The text TYPE in the docs are the literal characters TYPE, not a syntax placeholder. The difference is the "table.column" are in italics while "%TYPE" is not.
David J.