Jeroen Olthof wrote:
> What is going wrong here?
>
> An example of what I'm trying to do.
>
> vw_teams is a view but same problem when trying it on a single table
> CREATE FUNCTION test() RETURNS SETOF vw_teams AS 'select * from vw_teams;'
> LANGUAGE 'sql';
>
> SELECT test();
>
> results in
>
> test
> -----------
> 137789256
> 137789256
> (2 rows)
The capability to return composite types (multi-column rows) is limited in <=
PostgreSQL 7.2.x. What you are seeing are pointers to the rows, not the rows
themselves.
Version 7.3, in beta testing now, will do what you are looking for. If you
can, please give it a try. See:
http://developer.postgresql.org/docs/postgres/xfunc-tablefunctions.html
for more info and examples.
HTH,
Joe