Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vJ5qP-00AMJ0-1p for pgsql-hackers@arkaria.postgresql.org; Wed, 12 Nov 2025 08:04:44 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vJ5qN-00A5Kn-15 for pgsql-hackers@arkaria.postgresql.org; Wed, 12 Nov 2025 08:04:43 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vJ5qN-00A5KG-05 for pgsql-hackers@lists.postgresql.org; Wed, 12 Nov 2025 08:04:43 +0000 Received: from mail-pg1-x529.google.com ([2607:f8b0:4864:20::529]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vJ5qL-006gxj-0B for pgsql-hackers@postgresql.org; Wed, 12 Nov 2025 08:04:42 +0000 Received: by mail-pg1-x529.google.com with SMTP id 41be03b00d2f7-b4755f37c3eso418358a12.3 for ; Wed, 12 Nov 2025 00:04:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1762934680; x=1763539480; darn=postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=RC5oKPaPVcqeYtYmcoQ4poCVQspa5FxxeKej+GsQliE=; b=T67170IRpL3bbx9Be8SCFvL4rEUEnsBtjO6uaVk8JIvmKOf60VFQzOF60KMJkECOUp gYu1fO99RZ30g3fJWXPtugG//YQLJkktcTNkKtp7AiH/Ei3ZeE/Y+0uZHUxLUGl9ywQP DiJk1BnRYmBndAH2M7e1LFhRi/ld1To2uhWDcyOBKvJVKL8wv/UupY+0qQavdpd5Ko7h av5mtYxbJxeBXn2VfmIYn4NKpdwPYC49Kkz/WTIba0miTtkKatPemUCsHlqsf7273s6p MjvdUy12XmpRic7NAX9OmucK41pbydF6SGb8yb8KVYM7wbaKcNXrqiuJE/Iz3IXlgxXt v86A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1762934680; x=1763539480; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=RC5oKPaPVcqeYtYmcoQ4poCVQspa5FxxeKej+GsQliE=; b=hNFI8c6z1Mi85+tCTT+TRseG5WNw1m/gcLz02Ztzl+hLPhkAbC8lwoao9FUw3lUD7m ix37mjloHHbnVBGe1SSkuzXzXz38wy/QeYj8JS8aM14nfthkMw2vsjc2YVKVAIyXagiD HrjIvYQW5YbZiI1yeiSyObJULc+RDo4xc1L3dbJsIpM3tmo39QqtbFsKG+WtROeAK+Tu EFhCPbF1l01dwMVf4zAV4Xu/zdqwSYF90na0/2aqDlDfz1VI/r5SSgTp5gFAwJc7vs4c dUoJIxKXG05cW3rmExRqVLN8jcIiAKUq+AhecA6SdHNy+CE5glUSDrZh07K4hsb+0QV+ P0DA== X-Forwarded-Encrypted: i=1; AJvYcCWt81Kkjaq2K9ZJHkR4r/ja846k0eT5QC5mmdfZ+SbSa2fzQkf9Afr4isuxPz554OjWxzyzHxZUaXRslTg5@postgresql.org X-Gm-Message-State: AOJu0YyFmDRIFAt5CUDd7vLKhhgXk1mX5Akz7Mfh1qUFyFo5jf2DyqM2 q5PizVIWHlvzP55Q5RGJDKyhbieDfyXAIz5qqFuBoe6o0fZ1PrrCDkOBEhZ81AcDNceg4vNtJrV vkuCSejEhARKjvc+mFltOo+JMOmf5o5k= X-Gm-Gg: ASbGncvPYir0cQlJB5Za8fb0GW4Z+qcb2R0ryNh4djpyAyaaWyh9o9TWpxZ3yaqCofu UD3bsFA/0HPfdUim2t49lGbRFFO9x53kUX58OHZhvgE71D4bMMT8IzlRpozE8oVwc33/ldhLqjA rfIRH0Lkcfak2s2AyonsOOYhjkTzZUiPjacK3Zp+1jCpQ31ySL3m+n+mCZwAUxCEMudL8NXx+WH ghv8s5aWgtjZ0mBblv128ySuND+YXhAAh29K3SvqfAVI33MusQkH45XgoRxrYTtPZzfVRA= X-Google-Smtp-Source: AGHT+IGepyZ6TkCXsAt53g4IZpD2cziWl/eqRDnI8HQsjFdU94bspPyPT9eac19IbZ4uhxSn/5ljf7ftYQr/eG92FK0= X-Received: by 2002:a17:902:e788:b0:297:e69d:86ac with SMTP id d9443c01a7336-2984edc8d1bmr30345695ad.39.1762934680145; Wed, 12 Nov 2025 00:04:40 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Nazir Bilal Yavuz Date: Wed, 12 Nov 2025 11:04:28 +0300 X-Gm-Features: AWmQ_bnu5Op7h-HnJCJz4jBF2hgblEnWnhwERaL4r5DDQBuHY2gEs7i1QKznL7A Message-ID: Subject: Re: Trying out read streams in pgvector (an extension) To: Thomas Munro Cc: Melanie Plageman , "Jonathan S. Katz" , pgsql-hackers Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, Thank you for working on this! On Wed, 12 Nov 2025 at 07:12, Thomas Munro wrote: > > On Wed, Nov 12, 2025 at 12:19=E2=80=AFPM Thomas Munro wrote: > > On Wed, Nov 12, 2025 at 11:52=E2=80=AFAM Melanie Plageman > > wrote: > > > If we are worried about regressing other extensions using > > > read_stream_reset(), we could make the read stream reset which > > > preserves the distance a different function in backbranches. > > Here is a draft patch like that, that tries to be as small as > possible. Trying out the name read_stream_resume(). I liked the idea of having a different function named read_stream_resume for this purpose. 0001 looks good to me. 0002: + /* End-of-stream. */ + buf =3D read_stream_next_buffer(stream, NULL); + Assert(buf =3D=3D InvalidBuffer); + buf =3D read_stream_next_buffer(stream, NULL); + Assert(buf =3D=3D InvalidBuffer); I noticed there are two 'read_stream_next_buffer()' and 'InvalidBuffer' checks. Does having both provide any additional validation? I tried removing one of them, and the test still passed. Also, there is one thing I wanted to clarify about the 'read_stream_resume()'. If 'read_stream_next_buffer()' returns an 'InvalidBuffer', then we can use 'read_stream_resume()' alone because we know that we already consumed all buffers in the stream. For the rest, we need to use 'read_stream_resume()' together with the 'read_stream_reset()', right? --=20 Regards, Nazir Bilal Yavuz Microsoft