Query that will not run a ValuePerCall SRF to completion?

From: Chapman Flack <chap(at)anastigmatix(dot)net>
To: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Query that will not run a ValuePerCall SRF to completion?
Date: 2021-10-02 23:32:21
Message-ID: 6158EC05.7070007@anastigmatix.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

I am trying to improve (i.e. have any at all) test coverage of the
ExprContextCallback for a ValuePerCall SRF function handler.

I'm having difficulty coming up with a query that actually doesn't
run the SRF to completion.

The form I've been trying looks like

SELECT *
FROM
executeSelectToRecords('SELECT * FROM generate_series(1,1000000)')
AS (thing int)
LIMIT 10;

but even that query calls executeSelectToRecords for all 1000000 rows
and then shows me ten of them, and the callback isn't tested.

Is there a way to write a simple query that won't run the SRF to
completion?

Thanks!

Regards,
-Chap

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2021-10-02 23:44:25 Re: Query that will not run a ValuePerCall SRF to completion?
Previous Message Daniel Gustafsson 2021-10-02 23:27:56 Re: Better context for "TAP tests not enabled" error message