Reading the post again I caught a typo in my query. I had been playing
with variations of this test to try and get it working, but I have had no
success with any combination as long as it returns this kind of type.
I was comparing integers to uniqueidentiers, which actually works, but is
unrelated to the issue.
Should be:
> CREATE OR REPLACE FUNCTION test.break_guid (numlower integer, numupper
> integer) RETURNS SETOF test.guid_plus AS
> $$
> DECLARE
> x RECORD;
> gplus_ret test.guid_plus;
> BEGIN
> FOR x IN SELECT id,num FROM test.guid_table WHERE num > numlower AND
num
> < numupper LOOP
> gplus_ret :=
> (x.id::uniqueidentifier,x.num::integer)::test.guid_plus;
> -- I usually do the following: (but tried above with same result)
> -- gplus_ret := (x.id,x.num);
> RETURN NEXT gplus_ret;
> END LOOP;
> RETURN;
> END;
> $$ LANGUAGE plpgsql;
Jonathan Gray
jon5pg@streamy.com