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 1rfocC-002Tg2-1V for pgsql-hackers@arkaria.postgresql.org; Thu, 29 Feb 2024 22:10:56 +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 1rfoc9-0092kF-W8 for pgsql-hackers@arkaria.postgresql.org; Thu, 29 Feb 2024 22:10:54 +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 1rfoc9-0092k7-ND for pgsql-hackers@lists.postgresql.org; Thu, 29 Feb 2024 22:10:54 +0000 Received: from mail-pf1-x42f.google.com ([2607:f8b0:4864:20::42f]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1rfoc6-002Dqj-2K for pgsql-hackers@lists.postgresql.org; Thu, 29 Feb 2024 22:10:52 +0000 Received: by mail-pf1-x42f.google.com with SMTP id d2e1a72fcca58-6e571666804so1055335b3a.2 for ; Thu, 29 Feb 2024 14:10:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=illuminatedcomputing-com.20230601.gappssmtp.com; s=20230601; t=1709244650; x=1709849450; darn=lists.postgresql.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=bTHjBM06HV/qOLdtNtVCibYUUXzWt1Ad2B35fdspLNw=; b=xtWS4StdjT9JtdD4CKp7uAhhm1s9/jVWYBhm0pUvR8IvhjgPjHPItWV4dm4ki1cseH rf/h+htjSaqnU07GjsF5aZ8cFHZB4/yxg/ZeckZgtR/tWYUmVoN15oQ1uMuQOxzvruqJ ZmaodKP1Ilt3zn1c6xS33Bk8e4BK7SR0jjYiW1oRB6aNGXMIjSe2yREBaKNBx6+jiir7 6J/WHx0jzawSs61N85Z5CHySJyWV/Dqk9NSXEscc6tSoLDkA7Ev0F5P8zCKW+iSkJxns jsNds1A1J/YHKRL2rjNCiHVIl2CmohhGbhnMr+t9zoUpzrSHimRusNVp7w4AGQ52KTCY +LCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709244650; x=1709849450; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=bTHjBM06HV/qOLdtNtVCibYUUXzWt1Ad2B35fdspLNw=; b=tbzejs5U+7hxUXw6xMFvGkHLlEPIQoM76IOAF4qQU9wcDQD/oeg9zSJSP2zMsN9o2y YMvAnEWErhLEaCUow0ZSIpkIkhvTFAJ7KbWhk2MrNwjEWtTMhLUaKJ/0UMiQTMiLev47 cli75HGalpgQf6Tq+XezacwI+qH+j/+4q2sK6880CgDPbg457tPApezW0fn/j2O+5Sup RLvgyb9p2bF7FRUxGVmGaByfCWQlyioEBF8tR9/YBSLwQyHm1DLT0z0tPd9URaUujYcG NHIn7MUam4mEBrg4w/+wPZFh1Hv7E5k+67a3oVuuuHAoMsJAoCw6A1UIaG05Vc51HFTm SnLQ== X-Gm-Message-State: AOJu0YwQV7SgujGX3h4pkWeSQR+qq29UiewgJkhK4QyMSnLJapjNMiTe fGpDAU7V5f1OrMFDYsGPK1zrfcA5U/9+EED9oj0uPVBmRs8y9Ak3Za1eMWQ1X2c= X-Google-Smtp-Source: AGHT+IGMyrp6Hy69l/32YwIDTLqoaEuIGZudBjp5S4JgQawWt+a0rGjvgJl3dk0Ig/7+n1EZ/EKXBQ== X-Received: by 2002:a05:6a00:9295:b0:6e5:58cf:89b7 with SMTP id jw21-20020a056a00929500b006e558cf89b7mr6994pfb.4.1709244650196; Thu, 29 Feb 2024 14:10:50 -0800 (PST) Received: from [192.168.2.139] ([50.53.98.191]) by smtp.googlemail.com with ESMTPSA id jw13-20020a056a00928d00b006e5574db193sm1817050pfb.18.2024.02.29.14.10.49 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 29 Feb 2024 14:10:49 -0800 (PST) Message-ID: <3f137c66-ef48-4b3c-8028-9dceb2580df8@illuminatedcomputing.com> Date: Thu, 29 Feb 2024 14:10:49 -0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: SQL:2011 application time Content-Language: en-US To: jian he , Peter Eisentraut Cc: PostgreSQL Hackers 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> 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 2/13/24 21:00, jian he wrote: > 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, Fixed in v25 (submitted in my other email). > 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? That branch doesn't exist anymore. Same with the increments. > 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]); There are places we do that, but most code I've seen tries to fill the line. I haven't followed that strictly here, but I'm trying to get better at doing what pg_indent wants. Yours, -- Paul ~{:-) pj@illuminatedcomputing.com