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 1wzEzZ-003teP-2w for pgsql-hackers@arkaria.postgresql.org; Wed, 26 Aug 2026 14:52:42 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wzEzY-00E8pJ-2s for pgsql-hackers@arkaria.postgresql.org; Wed, 26 Aug 2026 14:52:40 +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 1wzEzY-00E8pA-1o for pgsql-hackers@lists.postgresql.org; Wed, 26 Aug 2026 14:52:40 +0000 Received: from mail-ed1-x533.google.com ([2a00:1450:4864:20::533]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wzEzW-00000002Wpd-3cc7 for pgsql-hackers@postgresql.org; Wed, 26 Aug 2026 14:52:39 +0000 Received: by mail-ed1-x533.google.com with SMTP id 4fb4d7f45d1cf-6a374bea882so1364268a12.1 for ; Wed, 26 Aug 2026 07:52:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=planetscale.com; s=google; t=1787755957; x=1788360757; darn=postgresql.org; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:from:to:cc:subject:date:message-id:reply-to :content-type; bh=/LTfBSP420LUyizm7/+ZxaU/KvR85UapryVYfJWXSiY=; b=YeXloq+TydzzCZ+WG1ChXxGsls90coVh3wOVGfUvDacF5x27nXdNFClTrD8O5qK5DT atbo8EQElV7vYj6d20V4nloz5jlVLp9uhQusCBEGvbHgRjSi18SdYqVXdtDIa5oUp5WV oZnzUU2edC2N/ffUuSHoECicCL8GpKrmMS2hUAqz7I7gzZ0e0+SHvHx49xjktUxbc8f3 VLvA/9u5EzPgR2dGOnT0YdxitMnK5rIv2jMNQYF9MKhDXRlAjqCYun3IXKiZJbJUPZOd 2SdKt3TL+C7yrW4zsA6CKTqOqCxOm4Cpc8QUsyaDSReoaR/fg+m3iI9UlPpfyYV8mKcS /OJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1787755957; x=1788360757; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=/LTfBSP420LUyizm7/+ZxaU/KvR85UapryVYfJWXSiY=; b=Ng9MmQMYgHXF/GiG1vUoxNGa+AGJHW5F96/AAYlafq/4EtKNjjgWpAD8LPERSJhCru jiw8jvi4JbdFui2CXFaosRLf5mPCLqmfSq8zicBTYcsuD5w5PSvB9QIEpmrZgrrJEW4k WSK2ON8+9teQmlgQbn3zZtv4BCShilC63F6PapLnmPcDLrSzWo3runotd6y3FyUc4wY1 AgQG1JPuYL1zNKFeSOVy82S71XAlj8oCgt5TBk5ZIQsXDe0j+An9Gx+iS9iXWXXXxIOF VVhXHOWyKAVX0LFv8fuSPeuICv9Uu0HAs6lrR9sh2INTx6/bzXBenzTtE0qJRLQbyM6s EYsw== X-Forwarded-Encrypted: i=1; AHgh+RoGGpZIpJ1NlhGlmrZtu81lgWNmnulLcRqVWPY59wYo2P996RM7gljFlvFplzjlluaejgUhXPeA9JfsRrcF@postgresql.org X-Gm-Message-State: AFuF++mz4pSX3czbfhPUl+YOWYf51poHdvN+D1DMhOksJbzsFiaQKiQW X6MAo2NNaVzsEWzEmTEYZKRWCx1jRkGiw3naRRPQkN197THROH+L3REdYS/M1dqII5g= X-Gm-Gg: AR+sD12K9Uin4kpd5N0Beb2iTbCuRFZEG6Q8i2cYSkL20wU3QUCSsYsj9t0leyelezR k0aDgbLpBliww0OUB9pZPHNJudWF+UDn0twOIHzpPyGwKS+LvP93kZ5UWFnOpHKG/M/IU9DEabF 4FmJAV30e2lhEHV0SVJaanBsmYYJPsimnHCtLQ8dF0U6uiIMa7RhvEg30c+MsY7CNz8JCTRPqqt 37fcgIzWnPkJwEYMftxYEYv8isQ8WU597NCT/+R/NB1HLQjGg0X9m/8vA1a4nevdEyK0XujdOZy x7JRfWhETDCyacka3mh/s+UaKLHOJbt0UDYvYMRnoNL1w09fICzbi39PQVIBjtnrhukrpy2i6A+ 7OjytXALNQ7yMA6ArXvP+ELSEGISfGdYA4qhOvY2YRAlkgEtwIA2Afg2CQMlOgMkR4ZQgDsQCHq A2R1dl8pbTVEL5wO9grrcD6eQPigHQYkltm4isPq28IEyy0t7+cjnT8Ye9gIC1/ZNWwjt+/HcCF 1FCdVzk5xHPXUNyKIZP/kxb5LpTGkJbWVxirFI/H0bc5QDsY5S8va8Qo5ti X-Received: by 2002:a05:6402:52ca:b0:6a0:9776:cb5b with SMTP id 4fb4d7f45d1cf-6a5df670b76mr9048999a12.13.1787755957145; Wed, 26 Aug 2026 07:52:37 -0700 (PDT) Received: from ?IPV6:2a04:4540:6503:eb00:f489:5e0f:4d08:1e69? ([2a04:4540:6503:eb00:f489:5e0f:4d08:1e69]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-6a5deafc5fbsm4303465a12.29.2026.08.26.07.52.36 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 26 Aug 2026 07:52:36 -0700 (PDT) Message-ID: Date: Wed, 26 Aug 2026 16:52:36 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] Add tests for src/backend/nodes/extensible.c To: Aleksander Alekseev Cc: Michael Paquier , Rafia Sabih , PostgreSQL Development References: <29ff18e1-7cbb-4e64-b75c-4ea35d21a82a@planetscale.com> Content-Language: en-GB From: Jan Nidzwetzki In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hello Aleksander, On 25.08.26 15:51, Aleksander Alekseev wrote: > Many thanks for all the great feedback! I applied all refactorings Thanks for the updated (v4) version of the patch. It applies cleanly to master (2f4df67), passes check-world, and shows 94.29% coverage for extensible.c on my system. My comments for v3 regarding the missing .gitignore, STRICT, and parallel_safe are fixed. I think I found a small issue when table inheritance is used. test_set_rel_pathlist() does not check rte->inh. For example, in the following, no scan is performed on the child table (and a wrong result is produced). CREATE TABLE test_extensible_tbl(id int, val text); CREATE TABLE tet_kid() INHERITS (test_extensible_tbl); INSERT INTO test_extensible_tbl VALUES (1,'parent_row'); INSERT INTO tet_kid VALUES (2,'child_row'); jan=# EXPLAIN (COSTS OFF) SELECT * FROM test_extensible_tbl; QUERY PLAN ----------------------------------------------------- Custom Scan (TestCustomScan) on test_extensible_tbl (1 row) jan=# SELECT * FROM test_extensible_tbl; id | val ----+------------ 1 | parent_row 1 | parent_row (2 rows) Changing: if (rte->tablesample != NULL) return; to: if (rte->tablesample != NULL || rte->inh) return; in test_set_rel_pathlist() should fix the problem. > except for the following. > >> - Much better for me: add_int_reloption() to force a custom scan to >> return a number of rows you want with a CREATE TABLE .. WITH >> (repeat_count = N). That's doable once the library is loaded, and >> that should be a few extra lines of code. So let's add the reloption >> to control the scans rather than hardcoding it. > > Perhaps I'm not fully understand the proposal but it doesn't seem to > work. Particularly after `git apply test.txt` I get: > > ``` > TRAP: failed Assert("numoptions <= num_relopt_elems"), File: > "../src/backend/access/common/reloptions.c", Line: 2246, PID: 2077291 I can reproduce the issue when test.txt is applied. Also, on my system I see the assertion being hit: Assert(numoptions <= num_relopt_elems). The assert fires because parseRelOptions() counts every option registered for the kind, while heap_reloptions() still passes a fixed parse table, so numoptions exceeds num_relopt_elems, and I did not find an easy way to fix that. Apart from this, the patch looks good to me. Best regards Jan -- Jan Nidzwetzki PlanetScale Postgres Core Team