On 20/10/2011 22:13, Henry Drexler wrote: > On Thu, Oct 20, 2011 at 4:57 PM, Raymond O'Donnell <rod@xxxxxx > <mailto:rod@xxxxxx>> wrote: > > > Not sure what you mean by the above... that statement only gets executed > once, so the value of nnlength doesn't change. > > Ray. > > > > doesn't the function get executed once for each row in the query? > so in the below example Ah, OK - my misunderstanding - I thought you meant within one execution of the function. > threeee will match threee > but fiveu will not match five because it has not reset nnlength := > length(newnode); to measure the length of fiveu but is retaining the > length of threeee Are you sure about this? Try using RAISE NOTICE statements in the function to output the value of nnlength each time it's executed. Ray. -- Raymond O'Donnell :: Galway :: Ireland rod@xxxxxx -- Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general