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

Поиск
Список
Период
Сортировка
От Raymond O'Donnell
Тема Re: plpgsql at what point does the knowledge of the query come in?
Дата
Msg-id 4EA095A0.1060306@iol.ie
обсуждение исходный текст
Ответ на Re: plpgsql at what point does the knowledge of the query come in?  (Henry Drexler <alonup8tb@gmail.com>)
Ответы Re: plpgsql at what point does the knowledge of the query come in?
Список 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 по дате отправления:

Предыдущее
От: Joe Abbate
Дата:
Сообщение: Re: how to disable all pkey/fkey constraints globally
Следующее
От: Jeff Adams
Дата:
Сообщение: Re: Date Range Using Months and Days Only