Re: plpgsql at what point does the knowledge of the query come in? - Mailing list pgsql-general

From Raymond O'Donnell
Subject Re: plpgsql at what point does the knowledge of the query come in?
Date
Msg-id 4EA095A0.1060306@iol.ie
Whole thread Raw
In response to Re: plpgsql at what point does the knowledge of the query come in?  (Henry Drexler <alonup8tb@gmail.com>)
Responses Re: plpgsql at what point does the knowledge of the query come in?  (Henry Drexler <alonup8tb@gmail.com>)
List pgsql-general
On 20/10/2011 22:13, Henry Drexler wrote:
> On Thu, Oct 20, 2011 at 4:57 PM, Raymond O'Donnell <rod@iol.ie
> <mailto:rod@iol.ie>> 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@iol.ie

pgsql-general by date:

Previous
From: Joe Abbate
Date:
Subject: Re: how to disable all pkey/fkey constraints globally
Next
From: Jeff Adams
Date:
Subject: Re: Date Range Using Months and Days Only