Re: plpgsql at what point does the knowledge of the query come in?

From: Raymond O'Donnell <rod(at)iol(dot)ie>
To: Henry Drexler <alonup8tb(at)gmail(dot)com>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: plpgsql at what point does the knowledge of the query come in?
Date: 2011-10-20 21:41:52
Message-ID: 4EA095A0.1060306@iol.ie
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 20/10/2011 22:13, Henry Drexler wrote:
> On Thu, Oct 20, 2011 at 4:57 PM, Raymond O'Donnell <rod(at)iol(dot)ie
> <mailto:rod(at)iol(dot)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(at)iol(dot)ie

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Raymond O'Donnell 2011-10-20 21:42:02 Re: plpgsql at what point does the knowledge of the query come in?
Previous Message Joe Abbate 2011-10-20 21:41:47 Re: how to disable all pkey/fkey constraints globally