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 1ra7OH-0088wR-H6 for pgsql-hackers@arkaria.postgresql.org; Wed, 14 Feb 2024 05:01:01 +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 1ra7OG-003xAe-6g for pgsql-hackers@arkaria.postgresql.org; Wed, 14 Feb 2024 05:01:00 +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 1ra7OF-003xAJ-TT for pgsql-hackers@lists.postgresql.org; Wed, 14 Feb 2024 05:00:59 +0000 Received: from mail-ua1-x92b.google.com ([2607:f8b0:4864:20::92b]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1ra7OD-006ef0-GO for pgsql-hackers@lists.postgresql.org; Wed, 14 Feb 2024 05:00:58 +0000 Received: by mail-ua1-x92b.google.com with SMTP id a1e0cc1a2514c-7d2940ad0e1so3003213241.1 for ; Tue, 13 Feb 2024 21:00:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1707886856; x=1708491656; 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=wESz5IigURCzvdRTKO2GyA2BEvGOeLKK87uxKzeMZb8=; b=CQhXYXLVCabpWFsK3TMOKuVASkyj/1U8gzg/7wajSJZWuNuT8urle4chlIjqFZIbln owbtqoW7hDtI8xCqfpk/TGUaGvGHLYKTcNe2WmcWtaeo4pXESCMt8Nqc7wY45HgYZwiJ tZTv6XW9xBy2RZRpJKfCpAhOdPD4sNqbsGjReW4IRc86tYYG0XA2Z8IL++n7QimNeD4V bIs/Bl5QAucGfE0BP8YMDPp3UooeEOTZ1ILbTt+cO4iu765+lUzAEY+2/FmZjy9Ciws8 nCKLl69BAxHoJYXA/dj79alx1v3CSp5I+Ty38Dr6U7/gInrwC6dKkDYKqevAKHIbuAfK D3pg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707886856; x=1708491656; 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=wESz5IigURCzvdRTKO2GyA2BEvGOeLKK87uxKzeMZb8=; b=QQfeJsNDM1LQ3HDq69QJpkI0xh/LnvipszO1HU6MZHI+VLrrmIqgQQcvw+koYzfDjt lmRUnyKc6GR6j8pU9663Hpb2Fd4BSwmpVevvyYBUSXADGl+IfY6W1ZZEa5HVYSpRZ9sD qvr7u+fcErzPtB+6H16m67Z+hxtRXOWVPLXme5jtTb/nS0olV3pinA0EIRHjmhQC72eA T66UcbDzSQP91pYJt2gQ+sbEPWKJjBgCIKWMnL6jxp4zTjaYj+zZh23rO/kJ+PnvidQ9 aIONoPV2rTkGMaDWwau7BKWSuGvTwKosdMlFYN/+nnSgqt4LNfOaDdhJ7rsy4hBxXsum rbhA== X-Forwarded-Encrypted: i=1; AJvYcCUU6NzZEeemX+ZrF2gShKIEmWON6+KRlG8NBcqCb2nTiZbQ7i2yrHnicErAY15VIs4yBX6cZdx+aBh7TrpU3yr5fjw6pCXUvCek03//A4uBz0RB X-Gm-Message-State: AOJu0Ywhe07WwAzga+Bi4FbhKVg4LfW8lD/w9WAcl6/BNGb/gy0RMRFw Nve440TyyzL8q83dABssQ+WVOTvYqYtAd+n96aHKocyaPm8sGPAkRLQZtJ32YfZripsFdYF2nu5 1LL175SPoQiiZn8JmYkJbw6s7dz4= X-Google-Smtp-Source: AGHT+IH2AOj4DB6zh7sMNoa1T145IC5Yk0qj0P03GGPFcnpPBUusxuZ3NlmPsTcCL876/IgzfwL0yDYGsFbi5TrzWeE= X-Received: by 2002:a67:ef93:0:b0:46e:c5e7:f7bf with SMTP id r19-20020a67ef93000000b0046ec5e7f7bfmr1526799vsp.27.1707886856536; Tue, 13 Feb 2024 21:00:56 -0800 (PST) MIME-Version: 1.0 References: <2d9740ad-3bb7-473c-8441-344351caa8ee@illuminatedcomputing.com> <596fefdd-6202-4228-b7c6-f240b1cbe06e@eisentraut.org> <35400587-6865-4a2c-9ea4-4761669478ea@eisentraut.org> <71b45adb-b496-4e58-b134-0a091014e63f@illuminatedcomputing.com> <7be8724a-5c25-46d7-8325-1bd8be6fa523@eisentraut.org> <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> In-Reply-To: <7bd1c8f9-a91a-41a3-990e-0f796ba692ec@eisentraut.org> From: jian he Date: Wed, 14 Feb 2024 13:00:00 +0800 Message-ID: Subject: Re: SQL:2011 application time To: Peter Eisentraut Cc: Paul Jungwirth , 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 more minor issues. + FindFKComparisonOperators( + fkconstraint, tab, i, fkattnum, + &old_check_ok, &old_pfeqop_item, + pktypoid[i], fktypoid[i], opclasses[i], + is_temporal, false, + &pfeqoperators[i], &ppeqoperators[i], &ffeqoperators[i]); + } + if (is_temporal) { + pkattnum[numpks] = pkperiodattnum; + pktypoid[numpks] = pkperiodtypoid; + fkattnum[numpks] = fkperiodattnum; + fktypoid[numpks] = fkperiodtypoid; - pfeqop = get_opfamily_member(opfamily, opcintype, fktyped, - eqstrategy); - if (OidIsValid(pfeqop)) - { - pfeqop_right = fktyped; - ffeqop = get_opfamily_member(opfamily, fktyped, fktyped, - eqstrategy); - } - else - { - /* keep compiler quiet */ - pfeqop_right = InvalidOid; - ffeqop = InvalidOid; - } + FindFKComparisonOperators( + fkconstraint, tab, numpks, fkattnum, + &old_check_ok, &old_pfeqop_item, + pkperiodtypoid, fkperiodtypoid, opclasses[numpks], + is_temporal, true, + &pfeqoperators[numpks], &ppeqoperators[numpks], &ffeqoperators[numpks]); + numfks += 1; + numpks += 1; + } opening curly brace should be the next line, also do you think it's good idea to add following in the `if (is_temporal)` branch ` Assert(OidIsValid(fkperiodtypoid) && OidIsValid(pkperiodtypoid)); Assert(OidIsValid(pkperiodattnum > 0 && fkperiodattnum > 0)); ` ` if (is_temporal)` branch, you can set the FindFKComparisonOperators 10th argument (is_temporal) to true, since you are already in the ` if (is_temporal)` branch. maybe we need some extra comments on ` + numfks += 1; + numpks += 1; ` since it might not be that evident? Do you think it's a good idea to list arguments line by line (with good indentation) is good format? like: FindFKComparisonOperators(fkconstraint, tab, i, fkattnum, &old_check_ok, &old_pfeqop_item, pktypoid[i], fktypoid[i], opclasses[i], false, false, &pfeqoperators[i], &ppeqoperators[i], &ffeqoperators[i]);