"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