Re: syntax error on Function return setoff

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: syntax error on Function return setoff
Дата
Msg-id CAKFQuwba1sr1FbBB9Qt+ExXC9-vmeNQTJrA1iNFM3qpw_bNpqw@mail.gmail.com
обсуждение исходный текст
Ответ на syntax error on Function return setoff  (Garry Chen <gc92@cornell.edu>)
Список pgsql-novice

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.

В списке pgsql-novice по дате отправления:

Предыдущее
От: Garry Chen
Дата:
Сообщение: syntax error on Function return setoff
Следующее
От: Andreas Kretschmer
Дата:
Сообщение: Re: syntax error on Function return setoff