Re: Query that will not run a ValuePerCall SRF to completion?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Chapman Flack <chap(at)anastigmatix(dot)net>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Query that will not run a ValuePerCall SRF to completion?
Date: 2021-10-02 23:44:25
Message-ID: 3723866.1633218265@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Chapman Flack <chap(at)anastigmatix(dot)net> writes:
> I'm having difficulty coming up with a query that actually doesn't
> run the SRF to completion.

From memory, nodeFunctionscan always populates the tuplestore immediately.
I've looked into changing that but not got it done.

If you write the function in the targetlist, ie

select srf(...) limit N;

I think it will act more like you expect.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2021-10-02 23:45:51 Re: 002_types.pl fails on some timezones on windows
Previous Message Chapman Flack 2021-10-02 23:32:21 Query that will not run a ValuePerCall SRF to completion?