plpgsql nitpicking -- possible TODO item? - Mailing list pgsql-hackers

From Rod Taylor
Subject plpgsql nitpicking -- possible TODO item?
Date
Msg-id 030e01c1c327$6d115d80$8001a8c0@jester
Whole thread Raw
List pgsql-hackers
In order to add items to an array:
ie. array[2] := variable;

Use the below works, but is quite slow (due to the execute):

DECLARE data ALIAS FOR $1; arr text[];
 -- Required due to bad arrays query text; rec RECORD;
BEGIN
 -- WHAT WE WANT: -- arr[1] := data;

 -- HERE''S HOW WE DO IT: query := ''SELECT cast(''''{"'' || data || ''"}'''' as _text) as
arr'';
 -- Expecting a single loop only. FOR rec IN EXECUTE query LOOP   arr := rec.arr; END LOOP

END;

--
Rod Taylor

Your eyes are weary from staring at the CRT. You feel sleepy. Notice
how restful it is to watch the cursor blink. Close your eyes. The
opinions stated above are yours. You cannot imagine why you ever felt
otherwise.




pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: elog() patch
Next
From: Bruce Momjian
Date:
Subject: Re: elog() patch