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 1vhu3z-009Qhu-06 for pgsql-hackers@arkaria.postgresql.org; Mon, 19 Jan 2026 18:33:19 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vhu3w-00ECNa-1k for pgsql-hackers@arkaria.postgresql.org; Mon, 19 Jan 2026 18:33:16 +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 1vhu3w-00ECNS-0O for pgsql-hackers@lists.postgresql.org; Mon, 19 Jan 2026 18:33:16 +0000 Received: from mail-oo1-xc2d.google.com ([2607:f8b0:4864:20::c2d]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vhu3t-001HhY-2r for pgsql-hackers@lists.postgresql.org; Mon, 19 Jan 2026 18:33:15 +0000 Received: by mail-oo1-xc2d.google.com with SMTP id 006d021491bc7-6610d479194so1792258eaf.3 for ; Mon, 19 Jan 2026 10:33:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1768847594; cv=none; d=google.com; s=arc-20240605; b=h8U+ziPYBeMJnTkFc+USVSfscmsF2EAA/b86aY2GpJcnQrqQogRunhSen911j/ygA2 oMiaOijEC/znid7UiGE0wn9m/SwP0YIiz57z8UUaeFV5rJA8GPTCUML8BRVo4smNFS0/ XK6mKicRZo99CKwcqqIfWv7Y00/s4aR+ZWTrgo6TyVyoTvUIVgdH6TsOqaM6adsYPObS 2a9DGQq/TS5Bo7W/nQpNGDmAQVOmewvCuX1enhTiJEdZJtSCLRrqUn3Hc+pr8ERA1O95 bZfNeI3G2l2v6ls/lzffcZPHtFufQR0eeR3m6FF+G5bw7R3qFGG1kPXfAhFSZn0m7opK YSgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=uKfa/DRd0E7R5aFqtWKHFURVppcfbAz9H3UbqB9iv5w=; fh=K0S8pBZz2In3bWXsz5G28x/7N382JPd7itKuI9E0dlE=; b=XE1u0vGShHDTPvdpgmxwrCZZ95f0BnO7UU9YNYXWBUNe4lWEvqy23jo8+UDPnVI3pA Zu4wSeQsAbl0SUYawm0YMqjHshTOv6rS7U8t4h6vBoq99xOFscm2ZudseIbiSEkXI5FV /7IiV8zZlIKdQPeivJ6OIBEqGrWbp1X2EkCLWbDN/eBEnq+ZkuEcBG82Tpd2ICgUn9Jm 0uhQ4QRmoC/YePLfyIzgVdTsej2cxgbdCKFMMM1vX1QaxZtfisKE8bZXMxZJG5FnSxgx sSX0TsEcUbYM5ZWdnN8Zv6xMBJvuyhtu7oMHB8WNl+orlyDrnbpO07/BE3SjDVIo1Ntr IRqg==; 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=illuminatedcomputing-com.20230601.gappssmtp.com; s=20230601; t=1768847594; x=1769452394; darn=lists.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=uKfa/DRd0E7R5aFqtWKHFURVppcfbAz9H3UbqB9iv5w=; b=Bfh8GEKT/9SKChNDp0AV96iV4625n7PI2nbBi/m8/6QtAIRPJ67FcdfYgwvHaDUCXL cS6gNbBWaOgUkvbUuL1JqhO2IMdLZKvfeh4fThlCd2jkkFqS8N/FgqZnuuMeiYNh3mQ9 4NwcItP+w2jh+fOEliobJC6247pbUgCxUVBqq/O+6MI3A0o2NzhFUBa1yAJCiWJ3ovuF GXlLT52lPVTwJBmQSUp8htxAR5gXB67QjuNFk0dXaMMBrs1aQys7ap7TZEXUn1u+ZMLQ jxagLudm5QCquLCevPPs5F8Bu43WaOX6pjTqvRC34OX9KyKdMdE3XgJJYclxoWVrcerD TAfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768847594; x=1769452394; 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=uKfa/DRd0E7R5aFqtWKHFURVppcfbAz9H3UbqB9iv5w=; b=SQzJW7M+L0sWC1uEh58Xa6ednOE7nWSIqG0SzPc4kGj6ilBlzfKaq3kgiHbSv+n5q7 7WvwYggqbY0Ie1qd7Wldrh9j/28sVkUGT9sAp7YKXD+AY0KQ2nFk971MJaMGZqwipmPL jQadH6WbxDn8oMNImxuB8teqOcdTedNno4JREUmygeyBTMr8oUTSGx+nXSJwq5A1w+by xKksp+ggy0kMLw1BUKhA9VU1dljtwJp38LTYuDgpTOHixvIRgrPyDDa67vrwf5WGmSCM sEdrdXS6TgHZT2Tc3XDO+Fglw52F/JgOmJFk26d+NoiWcOgFIlmWCUpAHouuLqYQoBQ4 ge5w== X-Forwarded-Encrypted: i=1; AJvYcCWdFGIkrjl2Kr4GzLxOBTUFwpM+UuEfV9Lmdn0YDd/aOn+U5KQJooMh0TRLN+QScEvfOARq/LDrbFBG4BLj@lists.postgresql.org X-Gm-Message-State: AOJu0YziBRgSJ6cwGNxJu3q39gSOvbK7qOb4srUOZ9pnGq726PunoR+a bT+xlJ5PTC7RwhABJ9y2yA00d3yN1oIKJM4YeiR+522CWZxssTD/W3dypCnkyHxEuY8dILnlnTz qZrBbutR9IZiAXoLjqvdavAVaRX4aI4DIwIypyzDMFQ== X-Gm-Gg: AY/fxX5lX8mbu+w/IQrEwbiVdzKI1rKj+2Z9BKv88oH3yeTt8OxXdXea3GDeop5DNDE 4nX18JwgxGJM1PwSt/tMbOsvQydbv0Qv9F+3P94APfGzHfgeQY+2o0vtQ9zhaxE8g8JFyLZ1EfM WXNUSBm3lnP4+qOdlDKx9KNt8pec+AFa88pnyu/R3xQOWrc26APEluQLIqojKrhoa15rXK/exwL XetdS3JegPUl3GvBdCxbVxQYA2dCsPSKv77p0+AMy0ShG3hRWdH39kk3SFVp1JsFPGSue4hwxVn Mxg= X-Received: by 2002:a4a:e714:0:b0:661:1b4e:d9c2 with SMTP id 006d021491bc7-6611b4edc08mr3200190eaf.65.1768847593865; Mon, 19 Jan 2026 10:33:13 -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: Paul A Jungwirth Date: Mon, 19 Jan 2026 10:33:02 -0800 X-Gm-Features: AZwV_Qh0s1t2WvxQ451Lc2yGVeZFPPLSs5qKfoMzCJEGaE7eSu3nXwUxKRG440Q Message-ID: Subject: Re: SQL:2011 Application Time Update & Delete To: Peter Eisentraut Cc: Chao Li , PostgreSQL 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 On Mon, Jan 19, 2026 at 5:37=E2=80=AFAM Peter Eisentraut wrote: > > 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. I agree that seems like an improvement. > > 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. Okay. > > 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. Okay. And ABI compatibility is only between minor versions, so no concern t= here. > > 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. Okay, that's great! Do we want a regress test in rangetypes.sql to confirm that these are set correctly (especially for user-defined types)? I checked manually after `make installcheck`, and they look fine, but should it be in our test suite? Here is another thought I had: As we've talked about in the application-time threads, I would like temporal features to be extensible enough to support user-defined types. We almost achieve that, but we need something like a "type support function". For primary key and unique constraints, we need a way to reject invalid values like empty ranges. For foreign keys we need an intersect operator (which is not currently in pg_amop, since it is neither for search nor ordering, and isn't involved in indexes anyway). And for UPDATE/DELETE FOR PORTION OF we need a foo_minus_multi to compute the "temporal leftovers". We could also ask for a constructor function, to build the targeted portion from the FROM/TO bounds. This is not strictly necessary, since we also have the FOR PORTION OF valid_at (...) syntax (which is used by multiranges). But it's something that would be nice to offer. In that case range types would not need these extra columns in pg_range. But recording the constructor oids in pg_range still has inherent value, and doing it now doesn't *prevent* us from later adding a facility to get a constructor function for FOR PORTION OF bounds. So I don't think there is any downside to recording them here. Yours, --=20 Paul ~{:-) pj@illuminatedcomputing.com