From: | jon5pg(at)streamy(dot)com |
---|---|
To: | "Jonathan Gray" <jon5pg(at)streamy(dot)com> |
Cc: | pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: Pl/pgsql functions causing crashes in 8.2.2 |
Date: | 2007-02-06 09:22:07 |
Message-ID: | 49232.76.172.130.214.1170753727.squirrel@webmail.streamy.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
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(at)streamy(dot)com
From | Date | Subject | |
---|---|---|---|
Next Message | Zeugswetter Andreas ADI SD | 2007-02-06 09:25:29 | Re: Proposal: Commit timestamp |
Previous Message | Magnus Hagander | 2007-02-06 08:22:47 | Re: libpq docs about PQfreemem |