Re: CREATE FUNCTION problem

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: CREATE FUNCTION problem
Дата
Msg-id 26892.973199700@sss.pgh.pa.us
обсуждение исходный текст
Ответ на CREATE FUNCTION problem  ("Cesar A. K. Grossmann" <cesar@rotnet.com.br>)
Список pgsql-general
"Cesar A. K. Grossmann" <cesar@rotnet.com.br> writes:
> create function
> vinculoExportacao (varchar)
> returns setof
> as 'select codigo, nome, ''T'' as selected
> from cad_exportacao
> ...
> psql:tmp/teste2.sql:15: ERROR:  parser: parse error at or near "as"

setof *what* ?  The parser is expecting SETOF typename.  In this case
you are going to need a tuple type that corresponds to the row structure
you want to return a set of.

BTW, please see my post from a week or two back that describes the known
problems with functions returning tuples and sets ...

            regards, tom lane

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

Предыдущее
От: Warren Vanichuk
Дата:
Сообщение: Re: Does this table exist?
Следующее
От: Norman Clarke
Дата:
Сообщение: Re: Speed issues with update