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.94.2) (envelope-from ) id 1s68kQ-00AJNd-TC for pgsql-hackers@arkaria.postgresql.org; Sun, 12 May 2024 12:56:14 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1s68kN-00B5XB-Bx for pgsql-hackers@arkaria.postgresql.org; Sun, 12 May 2024 12:56:11 +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.94.2) (envelope-from ) id 1s68kN-00B5X3-0F for pgsql-hackers@lists.postgresql.org; Sun, 12 May 2024 12:56:11 +0000 Received: from mail-lj1-x232.google.com ([2a00:1450:4864:20::232]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1s68kJ-000fLN-QG for pgsql-hackers@lists.postgresql.org; Sun, 12 May 2024 12:56:10 +0000 Received: by mail-lj1-x232.google.com with SMTP id 38308e7fff4ca-2e576057c2bso14454241fa.1 for ; Sun, 12 May 2024 05:56:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1715518566; x=1716123366; 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=ygYv6hrPr1HIsCm+P4DjGpQG+aig06/z+LEa9KwcXeA=; b=dUCxYVUFu93sK6ScAh2v1+IBq/Rssi4M0wqZlEfhBl/G9NsjH6VcUJ2pD4cE3fClhf MNaFAeebgvdXI4xsf0v1nFOmZihJFXzOZcmOq/lI3CYI5gMl+K6t/EzF/mBvb5odwg/e W29BI2CwFk98RdSR/8j7PUHSktaNf5ou/Jey4s3tebVl50sydFXAaoypt7Zb9G8mZQg4 lnewOf/cwlBkYCb2aMBISjwQnh26vwmS6XMZoHrv6SHrND+ZL4mytuToNCjFuvbzyVf3 7NCpJvifyZ/ilBi8xd54bxGAOEFY0fRHkY6KGrnkwt+xk0TDq6SmwHpL/lV1dqjLmV6Z zkxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715518566; x=1716123366; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=ygYv6hrPr1HIsCm+P4DjGpQG+aig06/z+LEa9KwcXeA=; b=jYgB57Ifazp8pz0Utv7kEYH2n1OaaaIov1oS9fXYQCz41Jci6J1JJcAUCLeAwAmZ0H zXwpDSxlHPR/uYIiO6IwhdvLl4ENIK78td5/yWtcVkgBomV93iVgVq5VnJhGxqBs4ooL YtQKJ9kftkiUr7EDnAJNTf2kYAnc466g29iuHpu1WJu0lKazig5Fx5ZrysGcpjl7BsYr +u8fBAYHalfWpzSBWDM9D7k1p6OP7xh3MUeHPo0PbkOBcOg3na57p9d9CCRfHJJir5FX 8xZ/FYOJAG+0eixCKBnAAyde2ws2+UWu0jRrGlHYHSvodSj3+Aeba9hTeW/EjvfZ9lw0 WPPQ== X-Forwarded-Encrypted: i=1; AJvYcCXWiRjSTmrpRJBmtKcz1z+4THrencTW0ZBaDfQjWsU1PXEFyfMZjWQsn0sUkIAONIje+eleWXcKYTWJrW+gn4vqzS1Ah7ACe5Z4rMrNeHmguudM X-Gm-Message-State: AOJu0YzSrn5WxIdcIpRuow+p3+JAVdiYevuSMu11pL+vvl8onkL64TvA IviKlgFrVyD1WVOxaQfFE9Dmu+f7UU/jjMrR5n4xHX4O/3nzeB5KSbCo6w/qGiXmg604CJaiIRF gSBv/v5aLsVxAz3lMkNanhY6l1eM= X-Google-Smtp-Source: AGHT+IHDH4GYx+w7k2M2jtSTfKGY2Dy+vE9BAtH6EHmuFGm/Evm3Ly42darq2+75L23fvuqGR2/T1Osd0RrT3+/H/aE= X-Received: by 2002:a05:651c:b0c:b0:2dd:bc53:e80 with SMTP id 38308e7fff4ca-2e52039daccmr69665541fa.51.1715518566284; Sun, 12 May 2024 05:56:06 -0700 (PDT) MIME-Version: 1.0 References: <85dd3ad0-fa79-46e8-a08b-c426c76825f3@eisentraut.org> <49c07eac-18ec-4aff-929c-e81b87df1092@eisentraut.org> <1edb3b79-a4bc-43b1-80aa-2e090472fe32@eisentraut.org> <47550967-260b-4180-9791-b224859fe63e@illuminatedcomputing.com> <1b2ab118-82c1-4e79-a094-04dab382e2c4@illuminatedcomputing.com> <3775839b-3f0f-4c8a-ac03-a253222e6a4b@illuminatedcomputing.com> <731ef81e-d4c3-41c6-ba8f-f6131f4f6407@eisentraut.org> <1426589a-83cb-4a89-bf40-713970c07e63@illuminatedcomputing.com> <5aefa87e-ba20-4a34-88aa-233255643c1b@illuminatedcomputing.com> In-Reply-To: <5aefa87e-ba20-4a34-88aa-233255643c1b@illuminatedcomputing.com> From: Matthias van de Meent Date: Sun, 12 May 2024 14:55:52 +0200 Message-ID: Subject: Re: SQL:2011 application time To: Paul Jungwirth Cc: Peter Eisentraut , Robert Haas , jian he , 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 Sun, 12 May 2024 at 05:26, Paul Jungwirth wrote: > On 5/9/24 17:44, Matthias van de Meent wrote: > > I haven't really been following this thread, but after playing around > > a bit with the feature I feel there are new gaps in error messages. I > > also think there are gaps in the functionality regarding the (lack of) > > support for CREATE UNIQUE INDEX, and attaching these indexes to > > constraints > Thank you for trying this out and sharing your thoughts! I think these are good points about CREATE > UNIQUE INDEX and then creating the constraint by handing it an existing index. This is something > that I am hoping to add, but it's not covered by the SQL:2011 standard, so I think it needs some > discussion, and I don't think it needs to go into v17. Okay. > For instance you are saying: > > > pg=# CREATE UNIQUE INDEX ON temporal_testing USING gist (id, valid_during); > > ERROR: access method "gist" does not support unique indexes > > To me that error message seems correct. The programmer hasn't said anything about the special > temporal behavior they are looking for. But I showed that I had a GIST index that does have the indisunique flag set, which shows that GIST does support indexes with unique semantics. That I can't use CREATE UNIQUE INDEX to create such an index doesn't mean the feature doesn't exist, which is what the error message implies. > To get non-overlapping semantics from an index, this more > explicit syntax seems better, similar to PKs in the standard: Yes, agreed on that part. > > pg=# CREATE UNIQUE INDEX ON temporal_testing USING gist (id, valid_during WITHOUT OVERLAPS); > > ERROR: access method "gist" does not support unique indexes > > We could also support *non-temporal* unique GiST indexes, particularly now that we have the stratnum > support function. Those would use the syntax you gave, omitting WITHOUT OVERLAPS. But that seems > like a separate effort to me. No objection on that. Kind regards, Matthias van de Meent