Re: Trying out read streams in pgvector (an extension)
Melanie Plageman <melanieplageman@gmail.com>
From: Melanie Plageman <melanieplageman@gmail.com>
To: Thomas Munro <thomas.munro@gmail.com>
Cc: Peter Geoghegan <pg@bowt.ie>, Nazir Bilal Yavuz <byavuz81@gmail.com>, "Jonathan S. Katz" <jkatz@postgresql.org>,
pgsql-hackers <pgsql-hackers@postgresql.org>, Andres Freund <andres@anarazel.de>
Date: 2026-04-08T18:06:04Z
Lists: pgsql-hackers
Attachments
- 0001-Add-test-for-read_stream_resume.patch (text/x-patch) patch 0001
- 0002-alternative-approach-for-test-read_stream_resume.patch (text/x-patch) patch 0002
On Tue, Dec 9, 2025 at 4:42 PM Melanie Plageman <melanieplageman@gmail.com> wrote: > > > 1. read_stream_resume() as before, but with a new explicit > > read_stream_pause(): if a block number callback would like to report a > > temporary lack of information, it should return > > read_stream_pause(stream), not InvalidBlockNumber. Then after > > read_stream_resume(stream) is called, the next > > read_stream_next_buffer() enters the lookahead loop again. While > > paused, if the consumer drains all the existing buffers in the stream > > and then one more, it will receive InvalidBuffer, but if the _resume() > > call is made sooner, the consumer won't ever know about the temporary > > lack of buffers in the stream. I ended up committing read_stream_resume() in 38229cb905165fe but without the tests because 1f6f200cab67e6, which added other read stream tests, was imminent. I'd like to add the read_stream_resume() test back now -- especially because we didn't end up adding another user of read_stream_resume() in this release. Attached 0001 is the test Thomas wrote ported over to be in the new 0004_read_stream.pl. It uses asserts instead of comparing output of the SQL function to expected output, so I included a potential alternative version of it in 0002 that uses that pattern. Note that 0002 is a diff from 0001, not an independent alternative patch. I think the test needs more work either way, but I wanted to get the ball rolling. - Melanie
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Add read_stream_{pause,resume}()
- 38229cb90516 19 (unreleased) landed