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 1rmVLS-008IX6-Al for pgsql-hackers@arkaria.postgresql.org; Tue, 19 Mar 2024 09:01:18 +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 1rmVLQ-00BUd7-V6 for pgsql-hackers@arkaria.postgresql.org; Tue, 19 Mar 2024 09:01:17 +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.94.2) (envelope-from ) id 1rmVLQ-00BUcz-LF for pgsql-hackers@lists.postgresql.org; Tue, 19 Mar 2024 09:01:17 +0000 Received: from mail-vs1-xe31.google.com ([2607:f8b0:4864:20::e31]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1rmVLN-005I55-Kq for pgsql-hackers@lists.postgresql.org; Tue, 19 Mar 2024 09:01:15 +0000 Received: by mail-vs1-xe31.google.com with SMTP id ada2fe7eead31-4739b6ddc94so681314137.0 for ; Tue, 19 Mar 2024 02:01:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1710838874; x=1711443674; 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=nqK2FmnqW75ibpt+/I7k+c3dihr8yWnnRUhyGpOoauo=; b=m9E8OYXNFygi1gft86082s/j1AZCk4wbihPdR2/zwwd+tllqO1np7ZCKCxwGu2HBKw dSoWLUidp0pY2UEtuwFTkjcxZ0Cm2J8P7A5DqQCx7zYgHoFYt10xwj2TprlSsWDJCp1A gcAATHV41qANflc0RakyGmHXTBnZudrh+UGQ93Nb7A5diMh69D3vzZEkjL7UwOc2bsa9 SWUZoWYhZEBjq0lo3d1othphPGErlZ/7Q99Z1nDLLVBLK7HIdpDzwnYqk0rq7WEGmCyU abEhLbsNTw9BzJVxyNCDfnJxHnAG8ocn0v5qzJwloD/6bAK9HPRoDHXXIgHi/7cRpH6g XK/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710838874; x=1711443674; h=content-transfer-encoding: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=nqK2FmnqW75ibpt+/I7k+c3dihr8yWnnRUhyGpOoauo=; b=w7gDMog7eWOgOGSzQRvN1jIkzQxaLbkRaGui28GoSfA0PtLYKqQwuW83Kd/18ESNec dvOtxNg20voicu+xjpyUyleXLu1k8nVLeYuR1hTTY6jAD7h+UF+zENLJeD++W6ljXylb +wPYPUFsLx0ncY6jQLBBcDdFtExDby8yJ3EB+a122wVB0zyu5DAcJazJdQ+aM9PGiowN Ve0NVfMDZttn0L/3C/v37clJDU8wtEfmE0IEp6sC4lJ6V0IJORv4hg3HxZ9nXM3jqhwJ qDSWAEctvMifwx0jhOGCFKVv1EQSLcjbFSD8SFNuuNyicw3oiGNzpwuJ6e9ESwnbpePo gyfg== X-Forwarded-Encrypted: i=1; AJvYcCWpOKR0XkaQ/0Cc03G8eUcULR8uR7kRxwIMoy9XRpD7MugipLYIxgnyvmlbkTs8lQRHM/HDz6TZcyZaiB10ndO6+h7z8fx8TEIiUp+T/EwlUEqH X-Gm-Message-State: AOJu0Yxx1Hu3K03Hv9uHKP99LE32qMklhXPd3qcuryCClhLkJ4uo/1RV gp3fz3lMwjk5GblsStr7/b+jLR/lNo0AOqM5QXCviV4NJt3dLCqaYAZfFTN647YTuqZzlQ6dCoL WvcjZAaJ6H8woYhMkGRziODSqavc= X-Google-Smtp-Source: AGHT+IFFsZiHnUVRw9E3Nq8BOXwmjuFk9MpWSX8+MZbiWJ8kUirSria6kGFbJjS73eGr7kDAAAYo/D2cR+17+UmiMSA= X-Received: by 2002:a67:e404:0:b0:476:9ac0:eab5 with SMTP id d4-20020a67e404000000b004769ac0eab5mr2247178vsf.0.1710838873936; Tue, 19 Mar 2024 02:01:13 -0700 (PDT) MIME-Version: 1.0 References: <0af6a323-f026-4cd9-adf1-941038cd00de@illuminatedcomputing.com> <88518c81-dcdc-4c5b-9200-146b74a520ab@eisentraut.org> <113f5e25-4455-4bdb-98ec-56275705cc4e@illuminatedcomputing.com> <7bd1c8f9-a91a-41a3-990e-0f796ba692ec@eisentraut.org> <6c3edb2c-bc45-4f19-babd-8f4edf39b384@illuminatedcomputing.com> <41b57948-f4d3-455f-8880-e0ce7e61ffc1@illuminatedcomputing.com> <0d977c63-f4a6-43ba-aad0-35c06c55df11@eisentraut.org> <9372f843-006f-4e79-a64a-b60178cf40e9@illuminatedcomputing.com> In-Reply-To: <9372f843-006f-4e79-a64a-b60178cf40e9@illuminatedcomputing.com> From: jian he Date: Tue, 19 Mar 2024 17:01:02 +0800 Message-ID: Subject: Re: SQL:2011 application time To: Paul Jungwirth Cc: Peter Eisentraut , 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 Tue, Mar 19, 2024 at 6:49=E2=80=AFAM Paul Jungwirth wrote: > > Rebased to 846311051e. > Hi, I just found out some minor issues. + * types matching the PERIOD element. periodprocoid is a GiST support function to + * aggregate multiple PERIOD element values into a single value + * (whose return type need not match its inputs, + * e.g. many ranges can be aggregated into a multirange). * And aggedperiodoperoid is also a ContainedBy operator, - * but one whose rhs is anymultirange. + * but one whose rhs matches the type returned by aggedperiodoperoid. * That way foreign keys can compare fkattr <@ range_agg(pkattr). */ void -FindFKPeriodOpers(Oid opclass, - Oid *periodoperoid, - Oid *aggedperiodoperoid) +FindFKPeriodOpersAndProcs(Oid opclass, + Oid *periodoperoid, + Oid *aggedperiodoperoid, + Oid *periodprocoid) I think, aggedperiodoperoid is more descriptive than periodprocoid, in 0005, you don't need to rename it. aslo do we need to squash v29 0001 to 0005 together? --- a/doc/src/sgml/ref/create_table.sgml +++ b/doc/src/sgml/ref/create_table.sgml @@ -1167,7 +1167,8 @@ WITH ( MODULUS numeric_literal, REM column(s) of some row of the referenced table. If the refcolumn list is omitted, the primary key of the reftable - is used. Otherwise, the refcolumn + is used (omitting any part declared with WITHOUT OVERLAPS). + Otherwise, the refcolumn list must refer to the columns of a non-deferrable unique or primary= key constraint or be the columns of a non-partial unique index. I think this does not express that foreign key is PERIOD, then the last column of refcolumn must specify PERIO= D? + + If the last column is marked with PERIOD, + it is treated in a special way. + While the non-PERIOD columns are compared for equ= ality + (and there must be at least one of them), + the PERIOD column is not. + Instead the constraint is considered satisfied + if the referenced table has matching records + (based on the non-PERIOD parts of the key) + whose combined PERIOD values completely cover + the referencing record's. + In other words, the reference must have a referent for its entire duration. + This column must be a column with a range type. + In addition the referenced table must have a primary key + or unique constraint declared with WITHOUT PORTION. + you forgot to change WITHOUT PORTION to WITHOUT OVERLAPS Oid pf_eq_oprs[RI_MAX_NUMKEYS]; /* equality operators (PK =3D FK) */ Oid pp_eq_oprs[RI_MAX_NUMKEYS]; /* equality operators (PK =3D PK) */ Oid ff_eq_oprs[RI_MAX_NUMKEYS]; /* equality operators (FK =3D FK) */ in struct RI_ConstraintInfo, these comments need to be updated?