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 1vhtIF-008zj1-2T for pgsql-hackers@arkaria.postgresql.org; Mon, 19 Jan 2026 17:44:00 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vhtIE-00E2Ld-2o for pgsql-hackers@arkaria.postgresql.org; Mon, 19 Jan 2026 17:43:59 +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 1vhtIE-00E2LU-1T for pgsql-hackers@lists.postgresql.org; Mon, 19 Jan 2026 17:43:58 +0000 Received: from mail-qt1-x82d.google.com ([2607:f8b0:4864:20::82d]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vhtIC-001HLm-0z for pgsql-hackers@lists.postgresql.org; Mon, 19 Jan 2026 17:43:57 +0000 Received: by mail-qt1-x82d.google.com with SMTP id d75a77b69052e-501502318b1so37336431cf.3 for ; Mon, 19 Jan 2026 09:43:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1768844636; cv=none; d=google.com; s=arc-20240605; b=GO9uWlfI2rIX1M1LkhUc+f3A63Fgtx6eykZ6y2j95NnZWocmhxaAS5oTs22m+E1TX9 oP/r8XN+tqKpUox8uFiZuzKxCJkx99xn5ZkMhpQS+ss283N51afo1yV5/YzJ+fMykQNH SZl6ENB6MwT6PiKo5a4pMJv+D4HPHcYIH+x7ciwWee/aZ+sccQc78hv3dSPrLcvafml2 9pm0LPphhx+TVILhcA3sn3/cR6/XFivijyvwUlI7djIiNOhILvLUVoQxtsRAiFq2wCzv 8uiMHPGgoUpCmEEZPtz7T5oQ4Yq4HFUeHWjDVFWA9fxgXlKcG08UEn+f/KveyWyhduca 4DFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:dkim-signature; bh=xx0w8EDZhmSIY5vLGLMxIG9p2BXFaoV3TrdT1bgcQJw=; fh=4YPRclxVyTiGdoj6tdBjOHtb1EQSl9lewLnmwlJY9vk=; b=cfgr5mvZmHFovaa9J06uTpYYKrbonr32S4YQd203yc3eOgD2z27s12alNstodWY9W0 KO3CvdY8LP1G1vyIdl/mQaXSBtTpyOIJ8qaBtxIa+y3MgZJPu/Z4g3MomyeLZXaZoulA eRdHdqoim7Paq+Fk4jZo7fFFqbHpShQzflxMiHEiAL2rn5wkY8n/ZrjD911VkQv1JsjG +DcgO+CTllyzEsZpzJgA5fWEADJ1+4wE0Kk/dUf4302U6/bjtOWr6np6z1hyPytcFnvb khkqQewGTNqpp1X6fm191R9lrYti6L6hq9D6bDUaecdeRjqZbcglMV1XLrxgCQAu4CR2 xV/g==; darn=lists.postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1768844636; x=1769449436; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=xx0w8EDZhmSIY5vLGLMxIG9p2BXFaoV3TrdT1bgcQJw=; b=GUV2DlqNTkKs+uIqpRcwFTmQ+yjhiqxTti2fxlIJ5u/3SKnxnO6SUZD3dHRrHN72XU bY5+YRStP84QJFjF1rcMgaodPAMs6eHT3g8vmqIRsE4v+NLQAzsnWvKczy2bB6SEjpLw cMmKjN0yRuBkLoM9WmI0Bt3pBAwqkaQxTGKaR4TKDfRWBcTFc1VkSg/zToOLEYraSwUH VKah5+Kq0z1lp+/LyPCKOjupu4U/3Ul/D/EunE8S4kQ10E0A/sER0ELM9l/7OAJ1zwlA hYqqYo+JEx1R0gb9G8C4nlVUNl1OBHP1ulFi8hJdWhUPbNLDIFRlS7tGwGEOGL3t4yrT eIMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768844636; x=1769449436; h=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=xx0w8EDZhmSIY5vLGLMxIG9p2BXFaoV3TrdT1bgcQJw=; b=bmTUo4f3TSemaNdENhEMqcv4wVxje5UzSdPJxWUT5pO3B7CxDNXTnTr0l2xQpbnw79 XW+D8XD00jct/3t/yKP8toUXkwkdfGDj05YpS1GabsJttZRGt+6yBeBClDW5JzETfoez +FSZCwROmvZJy+G5Nj4LF2p8UZ0a0XnfACEKMIWYOSMBVmpiPpyGIbmR4LPAXZzEoK0X xnfz7D+frgQE88b/utDvvx4Anqwibl9eP+kR9ejsQ28xlAfF4qcAWSPCCs659nnNAeZB Fe/LNmF3GMYlEAFU4I7yBmh7lqQB0payYmYyPLqjWqFJQ7mqaLIeQ6OsAwZS4BtFmpON yjzQ== X-Forwarded-Encrypted: i=1; AJvYcCV7TI5mRgfgdhX/vmOsu3Zdpf2FQD4iRr0Ts4o0r77ehCJyy9NDwwUZgs7dGlpuE2izNewmuUcyzSuCOY09@lists.postgresql.org X-Gm-Message-State: AOJu0YywfoJv/VUI+kZmlmhb20xHMfZmeD/X9YK9mjvosbP73yQNWm+b 7LYWPvthqpPNr+Y9DNIOxOYWhX+LmHJ03o6EqA6IIcw6i81ULIpsOS820DCQG0zhys4JtL2eQXu 0/Q/y3qaHRdvTVAY3glUsV8ZwCY6Ngq0= X-Gm-Gg: AY/fxX5/sEE6oSs0qSaK9EKDiZDFhcLmw0/PStFmhNdRPVk2FwtSm4BBNd9t2/R8tpV +TJU0rsHhWU26TGoCg2EU6MgquUxWOMDXHxA9QwvEXiei+yyEH8UBkcExwF9D/MZP5GBw0yA2GF F0K1JIMhUxCviEG3A84fzbXTt80eywXkvA3gHeHMJiThqZLBid79iYpahg4efnHQKfeHydchEns S3irdirLd4U3i1KJ2UVqjn00X8Y8pyPTwBEFOatKhii4V4NyPGz/LKZU8fsZdEyneHOlUzPbLCH +QEsoJmqe+jsw4Pw/aZ4C3IzOBGq5t077yOF9IUUX6Mc0h42eJSHHMR6q7vMaxADuQWc X-Received: by 2002:a05:622a:3d2:b0:4ed:aff1:3f45 with SMTP id d75a77b69052e-502a1771e33mr173895431cf.83.1768844635920; Mon, 19 Jan 2026 09:43:55 -0800 (PST) MIME-Version: 1.0 References: <2f5364f3-a1d3-4410-98f3-d788b11e6525@eisentraut.org> <1ace7bc1-9dd4-42c9-a473-517cef37cce9@eisentraut.org> <6F8D7105-BD1C-432D-84F3-BC688C0C8EDC@gmail.com> <9B820A52-D2F6-465D-B258-6FE8EBA59FAE@gmail.com> <53a13f97-340f-4d04-9dcc-77ca3ffb6a6a@eisentraut.org> <85ac7f0e-d95f-4377-ade0-8941fd328012@eisentraut.org> <7d63ddfa-c735-4dfe-8c7a-4f1e2a621058@eisentraut.org> In-Reply-To: From: Kirill Reshke Date: Mon, 19 Jan 2026 22:43:44 +0500 X-Gm-Features: AZwV_QjjAe-J48MNNlfgY-xo1KTEp_q25IFAjExAfs_yxdSz5GlYjTsMXbcwPdQ Message-ID: Subject: Re: SQL:2011 Application Time Update & Delete To: Peter Eisentraut Cc: Paul A Jungwirth , Chao Li , PostgreSQL Hackers Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Mon, 19 Jan 2026 at 18:37, Peter Eisentraut wrote: > > On 10.01.26 07:16, Paul A Jungwirth wrote: > > We would need to document these columns. > > Done that. > > > The C code uses `mltrng` a lot. Do we want to use that here? I don't > > see it in the catalog yet, but it seems clearer than `rngm`. I guess > > we have to start with `rng` though. We have `rngmultitypid`, so maybe > > `rngmulticonstr0`? Okay I understand why you went with `rngm`. > > I tuned the naming again in the new patch. I changed "constr" to > "construct" because "constr" read too much like "constraint" to me. I > also did a bit of "mtlrng". I think it's a bit more consistent and less > ambiguous now. > > > It's tempting to use two oidvectors, one for range constructors and > > another for multirange, with the 0-arg constructor in position 0, > > 1-arg in position 1, etc. We could use InvalidOid to say there is no > > such constructor. So we would have rngconstr of `{0,0,123,456}` and > > mltrngconstr of `{123,456,789}`. But is it better to avoid varlena > > columns if we can? > > I don't think oidvectors would be appropriate here. These are for when > you have a group of values that you need together, like for function > arguments. But here we want to access them separately. And it would > create a lot of notational and a bit of storage overhead. > > I had in the previous patch used some arrays as arguments in the > internal functions, but in the second patch I'm also getting rid of that > because it's uselessly inconsistent. > > > ``` > > diff --git a/src/include/catalog/pg_range.h b/src/include/catalog/pg_range.h > > index 5b4f4615905..ad4d1e9187f 100644 > > --- a/src/include/catalog/pg_range.h > > +++ b/src/include/catalog/pg_range.h > > @@ -43,6 +43,15 @@ CATALOG(pg_range,3541,RangeRelationId) > > /* subtype's btree opclass */ > > Oid rngsubopc BKI_LOOKUP(pg_opclass); > > > > + /* range constructor functions */ > > + regproc rngconstr2 BKI_LOOKUP(pg_proc); > > + regproc rngconstr3 BKI_LOOKUP(pg_proc); > > + > > + /* multirange constructor functions */ > > + regproc rngmconstr0 BKI_LOOKUP(pg_proc); > > + regproc rngmconstr1 BKI_LOOKUP(pg_proc); > > + regproc rngmconstr2 BKI_LOOKUP(pg_proc); > > + > > /* canonicalize range, or 0 */ > > regproc rngcanonical BKI_LOOKUP_OPT(pg_proc); > > ``` > > > > Is there a reason you're adding them in the middle of the struct? It > > doesn't help with packing. > > Well, initially I had done that so that the edits to pg_range.dat are > easier. But I think this order makes some sense, because it has the > mandatory data first and then the optional data later. But it doesn't > matter much either way. > > > This needs some kind of pg_upgrade support I assume? It will have to > > work for user-defined rangetypes too. > > No, I don't think there needs to be pg_upgrade support. Existing range > types are dumped as CREATE TYPE ... RANGE commands, and when those get > restored it will create the new catalog entries. Hi! I have looked into v2. This patch looks good. Making explicit links in pg_catalog seems to be more cve-proof to me. Using Paul's approach (get_typname_and_namespace) is not only fragile, it is a recipe for CVE if any mistake is made, is it? I mean, matching something by name is vulnerable for search-path-based CVE (again, not saying this is the case in Paul patch). I think patch tests are good. Also, I don't think we need to mention any "upcoming patches" in the commit message - this change has its own value. One stupid question from me: should we add ```` t.typanalyze!='range_typanalyze'::regproc or t.typinput != 'range_in'::regproc or t.typoutput != 'range_out'::regproc or t.typreceive != 'range_recv'::regproc or typsend != 'range_send'::regproc; ```` In type sanity sql check? In my understanding, this condition (t.typanalyze == 'range_typanalyze'::regproc and ....) is required for built-in range types, and for user-defined seems to also be true. -- Best regards, Kirill Reshke