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 1s5END-0045wg-Qf for pgsql-hackers@arkaria.postgresql.org; Fri, 10 May 2024 00:44:31 +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 1s5ENC-00Bmqm-1H for pgsql-hackers@arkaria.postgresql.org; Fri, 10 May 2024 00:44:30 +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 1s5ENB-00Bmqd-Kv for pgsql-hackers@lists.postgresql.org; Fri, 10 May 2024 00:44:30 +0000 Received: from mail-lj1-x236.google.com ([2a00:1450:4864:20::236]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1s5EN6-000Gey-CU for pgsql-hackers@lists.postgresql.org; Fri, 10 May 2024 00:44:29 +0000 Received: by mail-lj1-x236.google.com with SMTP id 38308e7fff4ca-2e538a264e0so116141fa.1 for ; Thu, 09 May 2024 17:44:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1715301863; x=1715906663; 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=2K2Tjvs/oMI3Ea6k6cmFAuo2FpX88wpT/ILV4oRStYQ=; b=jltLTi23qv25RUAbVQxPgEEZrmOHDRifd83KZYHRVspG8muo1R0pJ9FEC0eC6sT61x 0KoAG0zjSbgIJfwIG1c6mcvG09j8sJzq1wsv/Ti2AeRW1PupVF6tJVmch8cjU3MEUwqL sw3fEb5y3Xrp2kT+WsliPmZeB2L/Dq1xam1ZNxnKYwr/DplCV3Bq6YY36zgHCFZt6d6G WAVkOGKjxI06cBP1JFMQ+Zi9XXLf5rq/LvziDab5KZUGi9T4ICh2KYNHYCW771d8qmzR Scwcpc3Zly9KFLHq0ZcNQd6WkbN/QiM0WuNX+GJA+mfYtmZanZOXbr50VNGU+zCCAHhA jo8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715301863; x=1715906663; 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=2K2Tjvs/oMI3Ea6k6cmFAuo2FpX88wpT/ILV4oRStYQ=; b=B8DxqonVRDhae55FKo6BKCabcXfF0RwbUGUrOIB0exlgunwSsGX2gIdSeZAdUZtvM6 vPt+JfzjiJP8dtkJwazgcTk6Ix4HukeE6DvMBpc+BpCrzYRzmClHdAALZrwAbZDQ8LtY rWTEQH9f4D8bG8sEmqdu934PGjHNs9kL7a0rxJbUPRA6zL147KgTxaotBwgLYFA5C82Q Q3JRJJvcBRfIsrdT2siws1PBx7AmPUDC2p8y4k0saSEAVEJ5XTdQsVOASZpgkp/a79Jh FdO7QQld3TeQPRyzmLMYYgFAPkcHLiFrRS5Zknhp/qHFISYTYbwLcN/u16ajTi7G3xr/ Wfmg== X-Forwarded-Encrypted: i=1; AJvYcCXQ1N7I5IXI0yrqyYjrGFfPOpxxSsPe3XLgKEHJDRFpIgfAzMG4URvIqXqptMVh/CLdL3sLmn7LrL9btim9+mQVR/J/nj4UMDNCyy8OTdZUdtlY X-Gm-Message-State: AOJu0YyohmUd6QvVhLmZS+S0QcwPg9Mz+YmSvQRRsrCHjs8RnnXsBoxv OYRhJb4146BbQdURl7Z0/v/658riDdCuOOb8Rq1Fnus6Ho6zWC4KyyWhJxj8zhBhyDh00rp8vjW ECM1XFu79vfzOs0lbDPWAg+lukYoNwg== X-Google-Smtp-Source: AGHT+IEFAb9/6kyw4Tvpm3G+g/HhmECyB0RDbz71R769N0yJjFt4MRwh1LHyCfR/r2iPPG8oksDdGkLRZKwJR39CotY= X-Received: by 2002:a2e:8898:0:b0:2e0:3367:81fc with SMTP id 38308e7fff4ca-2e5205c80f3mr6150321fa.49.1715301862818; Thu, 09 May 2024 17:44:22 -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> In-Reply-To: <1426589a-83cb-4a89-bf40-713970c07e63@illuminatedcomputing.com> From: Matthias van de Meent Date: Fri, 10 May 2024 02:44:08 +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 Hi, 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. pg=# CREATE TABLE temporal_testing ( pg(# id bigint NOT NULL pg(# generated always as identity, pg(# valid_during tstzrange pg(# ); CREATE TABLE pg=# ALTER TABLE temporal_testing pg-# ADD CONSTRAINT temp_unique UNIQUE (id, valid_during WITHOUT OVERLAPS); ALTER TABLE pg=# \d+ temp_unique Index "public.temp_unique" Column | Type | Key? | Definition | Storage | Stats target --------------+-------------+------+--------------+----------+-------------- id | gbtreekey16 | yes | id | plain | valid_during | tstzrange | yes | valid_during | extended | unique, gist, for table "public.temporal_testing" -- ^^ note the "unique, gist" pg=# CREATE UNIQUE INDEX ON temporal_testing USING gist (id, valid_during); ERROR: access method "gist" does not support unique indexes Here we obviously have a unique GIST index in the catalogs, but they're "not supported" by GIST when we try to create such index ourselves (!). Either the error message needs updating, or we need to have a facility to actually support creating these unique indexes outside constraints. 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. Kind regards, Matthias van de Meent.