Re: Options to rowwise persist result of stable/immutable function with RECORD result

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Eske Rahn <eske(at)septima(dot)dk>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, Björn Harrtell <bjorn(at)septima(dot)dk>
Subject: Re: Options to rowwise persist result of stable/immutable function with RECORD result
Date: 2023-03-22 21:50:07
Message-ID: CAKFQuwbu7cQagO1V6nU2WAPbpFfsDYEAqKNr+aK2+ahdOkTZZw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tuesday, March 21, 2023, Eske Rahn <eske(at)septima(dot)dk> wrote:

> Hi,
>
> I have noticed a rather odd behaviour that is not strictly a bug, but is
> unexpected.
>
> It is when a immutable (or stable) PG function is returning results in a
> record structure a select on these calls the function repeatedly for each
> element in the output record.
>

The LATERAL join modifier exists to handle this kind of situation.

David J.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2023-03-22 21:56:22 Re: HOT chain validation in verify_heapam()
Previous Message Peter Geoghegan 2023-03-22 21:41:50 Re: HOT chain validation in verify_heapam()