Don't forget to cc: the list
Wilkinson, Jim wrote:
> Hi Richard, your example worked find , but when I substitue my view into
> the function and the tale name, I get the following error:
>
> ERROR: wrong record type supplied in RETURN NEXT
> CONTEXT: Pl/pqSQL function "create_view" line 11 at return next
The columns you're returning from the function don't match it's definition.
If the function is defined as RETURNS SETOF X then it needs to return
columns that match X. If you need to you can create a custom type (see
"CREATE TYPE" in the manuals).
If you want one function that returns different types then you can't
have it.
--
Richard Huxton
Archonet Ltd