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 1whlgZ-000PMf-1c for pgsql-bugs@arkaria.postgresql.org; Thu, 09 Jul 2026 10:08:52 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1whlgY-00CORI-02 for pgsql-bugs@arkaria.postgresql.org; Thu, 09 Jul 2026 10:08:50 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1whlgX-00CORA-1r for pgsql-bugs@lists.postgresql.org; Thu, 09 Jul 2026 10:08:50 +0000 Received: from mail-ed1-x534.google.com ([2a00:1450:4864:20::534]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1whlgV-00000000S0H-0wGd for pgsql-bugs@lists.postgresql.org; Thu, 09 Jul 2026 10:08:50 +0000 Received: by mail-ed1-x534.google.com with SMTP id 4fb4d7f45d1cf-698beff7178so3040413a12.3 for ; Thu, 09 Jul 2026 03:08:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=garret-ru.20251104.gappssmtp.com; s=20251104; t=1783591726; x=1784196526; darn=lists.postgresql.org; h=in-reply-to:from:content-language:references:cc:to:subject :user-agent:mime-version:date:message-id:content-type:from:to:cc :subject:date:message-id:reply-to:content-type; bh=1s+yc0bwXvw5u9PVSJGkUGnavxmGvSAUm1lG8ymxuFI=; b=0CF89jOnQEfrEKYH07l7bSob7uJXG1XnUDf7NV4xpCZk001zxdEWLdIEjPsunpSvsQ ii11U5+WX4kB5FD5GP6+i7uRJuS7+etAGl19uH3evRjSrk7cfeEQ9J55dahnkV/TI3OZ pU65+Th58Ks9/27WSg/eUxYUQXkir8pasgKRURUC1qgKwC4/A35vLnd/P8d35GkJ3EN9 eLnxMnt6hY6G5QLOr3vYmq5BnlD2nXxx6vMXgEc0BkufojwJnqSNf7Qw5FoS6FVNqbPr GYmr1fY3I0Nzv+aQ/N4ZkrU4I5Duaokfk117xnqRNCh4LWFlcyM1VofpryV8Zpb8cdfT aEZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783591726; x=1784196526; h=in-reply-to:from:content-language:references:cc:to:subject :user-agent:mime-version:date:message-id:content-type:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=1s+yc0bwXvw5u9PVSJGkUGnavxmGvSAUm1lG8ymxuFI=; b=KDAuQT/ImToa5+1cP3AkD4wtVsBar2S6vbDCu7akSa0xIlBEJWs6wAhXUwTMZAjO+P po63C4J01Swhy50XH+KhRyQ6Fv/wuV+ln+ukjfnubOfog9IqWhAmIXT24kyjpXPwI9Ik ViizT8NNQiLbIIcq3Zp2RNEWzliaBZ9rrV8gvecKNQ3Zk/12T4jT9zdV7OGus3n4SMEP 8lx2eWCua3zwKTHSFyQQ3bU/DKgOnna9NRCuYDfndGtG0FpW5PVPX9ge3eYXtPbR9QxL 0yW2aSEkilO/rvkloX/COc/1f7l6dBCuNPTySmzqsYdnqUbkjGVs8B6b6lrZwG48eJnQ +zNQ== X-Forwarded-Encrypted: i=1; AHgh+Rp440X/4AL/0TD7nfVQq3+ETtT3Xv3GMriZoSXmCixYElH22hM+2mnbiXLXJGOkorFqIN4n94L9Is1D@lists.postgresql.org X-Gm-Message-State: AOJu0YwjbGuxMu53avKmgvjtkCnyIFjyK7uDf0RDjv3LRIsqR3nZPiCb U2ritUSoOD8iX1Hqe5CtkzhkcB6QtPmLiJq99Re+N7G0S1CO4vcOfaxEg1CekHUJnA== X-Gm-Gg: AfdE7ckCd+9oVkvr1OzkxLn7VLnexbVnfDnoKBXd05RpVFmLaduOJsn1LJqNzXDBp10 CV816IzzyLshNurfkckrcr1zUkB5Alv0QZ1rhGFLkSnGanoBJ0zfJkoTXh2T87mly3swTeUmMNG iGH/yW7ues8O8WBv9J4BE7moIJrFeagqE7PcH1dWxWLsJf14RvzKZMKD+6xvVfG3TSg3XTUf5Ua pWdpSJZVOMGAKgGC3pT4FV6VFH/sIWpwajljFDfHLxZh6tPGr9Iaoe2RvFnbbCBrvJWEVzH23Od rt2ghkW+JpXd1YPLfG2wPHJowQkrCVMhn5j3SKmIhUxHp9N8dv9Hl4tDBrlNsXtMS1pTCSge8Dt mS+xWaZdpzHOwvtB6yC37Lw7kQ+t/WLvMlBPONk3e70EEWs2qTNwgKFGuHHGrgVmXbDexDMrNkS hMaNeLHBa0rfZiNcKTL0JZKbIg+A== X-Received: by 2002:a05:6402:28c6:b0:698:c208:b7f1 with SMTP id 4fb4d7f45d1cf-69ab447b546mr2536763a12.14.1783591726138; Thu, 09 Jul 2026 03:08:46 -0700 (PDT) Received: from [10.248.56.12] ([130.41.208.1]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-69a19db05ecsm8878511a12.28.2026.07.09.03.08.44 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 09 Jul 2026 03:08:45 -0700 (PDT) Content-Type: multipart/alternative; boundary="------------TtzdpfXLrQIi9jxyCLDF303f" Message-ID: <53dd03d4-5aab-405d-bff3-f3c5433edef7@garret.ru> Date: Thu, 9 Jul 2026 13:08:43 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: BUG #19519: REPACK can fail due to missing chunk for toast value To: Michael Paquier Cc: Heikki Linnakangas , Srinath Reddy Sadipiralla , Matthias van de Meent , Imran Zaheer , Alexander Lakhin , PostgreSQL mailing lists References: <21477053-efd1-485a-8f72-c2e292fcf2a0@garret.ru> Content-Language: en-US From: Konstantin Knizhnik In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --------------TtzdpfXLrQIi9jxyCLDF303f Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 09/07/2026 8:43 AM, Michael Paquier wrote: > On Thu, Jul 09, 2026 at 08:17:06AM +0300, Konstantin Knizhnik wrote: >> Changing `table_relation_fetch_toast_slice` signature breaks compatibility >> with some extensions, for example duckdb. >> I wonder if we can change only  `bool (*relation_fetch_toast_slice)(..., >> bool missing_ok)` callback signature, but preserve signature of >> `table_relation_fetch_toast_slice`, adding one more function >> `table_relation_try_fetch_toast_slice`: > Thanks for the input. > > Adding more functions implies to change the size of TableAmRoutine, > which may be bad. For now I'd be tempted to just focus on how to fix > the problem on HEAD in a way we are happy with. We could sort out an > optional back-branch version as a second step. > -- > Michael Sorry, I do not suggest to extend TableAmRoutine - it will contain single `relation_fetch_toast_slice` entry with new signature. I suggest to add only new wrapper function `table_relation_try_fetch_toast_slice`, preserving original `table_relation_fetch_toast_slice`. It will preserve compatibility with extensions (there are not using TableAmRoutine directly) and do not extend TableAmRoutine. --------------TtzdpfXLrQIi9jxyCLDF303f Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit


On 09/07/2026 8:43 AM, Michael Paquier wrote:
On Thu, Jul 09, 2026 at 08:17:06AM +0300, Konstantin Knizhnik wrote:
Changing `table_relation_fetch_toast_slice` signature breaks compatibility
with some extensions, for example duckdb.
I wonder if we can change only  `bool (*relation_fetch_toast_slice)(...,
bool missing_ok)` callback signature, but preserve signature of
`table_relation_fetch_toast_slice`, adding one more function
`table_relation_try_fetch_toast_slice`:
Thanks for the input.

Adding more functions implies to change the size of TableAmRoutine,
which may be bad.  For now I'd be tempted to just focus on how to fix
the problem on HEAD in a way we are happy with.  We could sort out an
optional back-branch version as a second step.
--
Michael

Sorry, I do not suggest to extend TableAmRoutine - it will contain single `relation_fetch_toast_slice` entry with new signature.

I suggest to add only new wrapper function `table_relation_try_fetch_toast_slice`, preserving original `table_relation_fetch_toast_slice`. It will preserve compatibility with extensions (there are not using TableAmRoutine directly) and do not extend TableAmRoutine.

--------------TtzdpfXLrQIi9jxyCLDF303f--