OK here is an example of a function where I had to create a type called login. How could I have written this function without having to create a type.
CREATE OR REPLACE FUNCTION "public"."loginbyindidget" (integer) RETURNS SETOF "public"."login" AS'
[snip]
There's an example in the manuals - chapter "7.2.1.4. Table Functions"
SELECT * FROM dblink('dbname=mydb', 'select proname, prosrc from pg_proc') AS t1(proname name, prosrc text) WHERE proname LIKE 'bytea%';
So basically, you need to supply the type definitions in your SELECT if you aren't going to supply it in the function definition.
--
Richard Huxton
Archonet Ltd
---------------------------(end of broadcast)--------------------------- TIP 8: explain analyze is your friend