Query that will not run a ValuePerCall SRF to completion? - Mailing list pgsql-hackers

From Chapman Flack
Subject Query that will not run a ValuePerCall SRF to completion?
Date
Msg-id 6158EC05.7070007@anastigmatix.net
Whole thread Raw
Responses Re: Query that will not run a ValuePerCall SRF to completion?
List 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



pgsql-hackers by date:

Previous
From: Daniel Gustafsson
Date:
Subject: Re: Better context for "TAP tests not enabled" error message
Next
From: Tom Lane
Date:
Subject: Re: Query that will not run a ValuePerCall SRF to completion?