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 1s5zrb-009Rdt-Ft for pgsql-hackers@arkaria.postgresql.org; Sun, 12 May 2024 03:27:03 +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 1s5zrZ-008XFd-Lv for pgsql-hackers@arkaria.postgresql.org; Sun, 12 May 2024 03:27:02 +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 1s5zrZ-008XFU-Cq for pgsql-hackers@lists.postgresql.org; Sun, 12 May 2024 03:27:01 +0000 Received: from mail-pf1-x42d.google.com ([2607:f8b0:4864:20::42d]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1s5zrW-000bLX-HC for pgsql-hackers@lists.postgresql.org; Sun, 12 May 2024 03:27:01 +0000 Received: by mail-pf1-x42d.google.com with SMTP id d2e1a72fcca58-6f44a2d1e3dso2974383b3a.3 for ; Sat, 11 May 2024 20:26:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=illuminatedcomputing-com.20230601.gappssmtp.com; s=20230601; t=1715484417; x=1716089217; darn=lists.postgresql.org; h=content-transfer-encoding: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; bh=Ao9VV/Q4iHx/yNOH1xwnIzabOJ3HuXTE/0C/oQ1lpF0=; b=jvgqoeJUEgW5wztu+YWdgleSpx41G9LCpK7G3VcBnbKxdLSVeQ60AFBRZvf1O9i382 G06gMpvD+M5JoYXRGMj6nNrQCXMexkAM5q8G56znETIUmu8/2sE65wRzpammFgLM7yVh 6uPooZikT7PoGvbF+49Il25Y5FvPU7rqoC2Qjt0u93+jwLutMpdZYm7ls2gRE+qkH9k8 tn8WQXJncUiAFSIa8zACjOdVINU2nVqInuHq7SZ5u+LLkD86c1JD2YEBhBfFKs/GWws9 MBkmM4SF290IlrXHFpoHzVMvK4E37qm+N6MB5RQ1HudnH3m8f+TS+/qDHc+5krliVvHb xZUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715484417; x=1716089217; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Ao9VV/Q4iHx/yNOH1xwnIzabOJ3HuXTE/0C/oQ1lpF0=; b=Z8OEcAHQUCYnwKTFicJOjrlUknRu4/XNWGaQt/LmZsp2VJiuuPHg5ApxgyFwRyOu6P hGSBMBZWhN9Ui0PSx/4M2Oa7L5oQOJll+sWZAJU/DGYuvMoorrDFUvoX/wFvpssyootW D/xhkMjVAdCWDe9JBv21W5GviaeXvx/VP9DCgxWhIOKxQN6nu7yPdXIUL4wJtH8hXZf+ tzgAwL668pFeeVPR7pWP7/rJqRvLw4uet6aZcM2i9UcYNlBvv2MVyUDa0vmN391YYKpV kJTV0OCv1qLMV4NUi4l8lafi4BTecxCdXWo2h7YBFfyMnq90yAfj4vurVPrvBh36IkpJ 3Fng== X-Forwarded-Encrypted: i=1; AJvYcCUF88Og4Y1n8jscGcjhC9+IFIs9qzL4BRzLk8hY1qgxWYqO0zxjHP+kP7yQqJCNkDYSEVl9oWYqyPrXNRJ4gxihRKofIgKSgCfn76zr+v5iXlcg X-Gm-Message-State: AOJu0YyNDZPUnoXt3bXKpY9rZahp6mP3rcgImfr+fgwOwNVYPuqcmyP3 kULs+DQtLfWmxzG60rMYQG5Ypdte2wpbx9BDJ97blaR8DT4yY8jFW3kM5gC3QuI/QdCo6o0wJu5 H X-Google-Smtp-Source: AGHT+IEWO2hPr3wKQR1skKkBH5idtbeBbMdf0bS7ajGSX38Zbr3KicL7nZHh3k4fZrMdks1GXIjLaw== X-Received: by 2002:a05:6a20:d70b:b0:1af:d6dc:86b9 with SMTP id adf61e73a8af0-1afde1faeb8mr6612171637.53.1715484416753; Sat, 11 May 2024 20:26:56 -0700 (PDT) Received: from [192.168.2.139] ([50.39.255.79]) by smtp.googlemail.com with ESMTPSA id d9443c01a7336-1ef0b9d1807sm55460205ad.59.2024.05.11.20.26.56 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 11 May 2024 20:26:56 -0700 (PDT) Message-ID: <5aefa87e-ba20-4a34-88aa-233255643c1b@illuminatedcomputing.com> Date: Sat, 11 May 2024 20:26:55 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: SQL:2011 application time To: Matthias van de Meent Cc: Peter Eisentraut , Robert Haas , jian he , PostgreSQL Hackers 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> Content-Language: en-US From: Paul Jungwirth In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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. 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. To get non-overlapping semantics from an index, this more explicit syntax seems better, similar to PKs in the standard: > 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. > Additionally, because I can't create my own non-constraint-backing > unique GIST indexes, I can't pre-create my unique constraints > CONCURRENTLY as one could do for the non-temporal case: UNIQUE > constraints hold ownership of the index and would drop the index if > the constraint is dropped, too, and don't support a CONCURRENTLY > modifier, nor an INVALID modifier. This means temporal unique > constraints have much less administrative wiggle room than normal > unique constraints, and I think that's not great. This is a great use-case for why we should support this eventually, even if it uses non-standard syntax. Yours, -- Paul ~{:-) pj@illuminatedcomputing.com