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 1sl7c8-005MfM-EH for pgsql-hackers@arkaria.postgresql.org; Mon, 02 Sep 2024 14:01:05 +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 1sl7c5-00EpWZ-JS for pgsql-hackers@arkaria.postgresql.org; Mon, 02 Sep 2024 14:01:01 +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 1sl7c5-00EpVU-5A for pgsql-hackers@lists.postgresql.org; Mon, 02 Sep 2024 14:01:01 +0000 Received: from mail-ej1-x634.google.com ([2a00:1450:4864:20::634]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1sl7by-000IT3-Mh for pgsql-hackers@lists.postgresql.org; Mon, 02 Sep 2024 14:00:59 +0000 Received: by mail-ej1-x634.google.com with SMTP id a640c23a62f3a-a86abbd68ffso700479366b.0 for ; Mon, 02 Sep 2024 07:00:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec-at.20230601.gappssmtp.com; s=20230601; t=1725285653; x=1725890453; darn=lists.postgresql.org; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject :date:message-id:reply-to; bh=pkC0swceL2rDeXKjeMZnPJvvJ//zBGGquV7ONEf1bxA=; b=kP2kjZA+4D2neXgt8iMe+2iU7hICnbnG5BoSs54NxerNulnXb7W0miOkyX8oByakpb RKo/QdvekWOBKtQ6RQdMB6eZMy39COhgAQNEeGWoGP6JpbG4elnmZR/CIngIW+cfp2x5 TQhQW+NGK4ztKwtehLeXpQPrmnyC4VzKXaUyZHwYB37m9/RtJhLAMFegWLpL57xhIi9A AiOAzOwH+SYIDbSCTno10pjCIuNHgHVKwg28FRV+YRPBSOm0g1FLpVMKw9oRy5XPF2xG Z44nWcR3NidF/LrgWJrb1VnEzjRpQYGUHJWBYMvacFDtovLQxKzsv7kcvZoh1KwJOky1 GaHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725285653; x=1725890453; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=pkC0swceL2rDeXKjeMZnPJvvJ//zBGGquV7ONEf1bxA=; b=E5vUBO6Jqv6fBdk1ATmx1nvosTmscMfslliqH6Z7WC9wnboThzTqb5RhEkZfJF3/Nr jCLYM5/tXCFyuBa/1cYdsjXiHQgfz0UUvt/pR2lvV5lty2pl16fBuK1blhl8SsVX+GyT b/dAZFg9IpoB77PO2fEDC043XsGRoRYA5BugIKDlZTWkCGYWNBuBhruPowjLwZ1Ae/B3 uuVjVCrHN41Vj7FaGl+J9gf+Hr9bGEjYNiYzWOpHtGp6LhnOspnbypoF8AugSikTyv7w /Op3JWmBArT7VrBsX5Tr2OBuPxv6tqcIYzWqLIOETLU4lUXWB21JilRAKqelc2z6LQUY 29Xw== X-Forwarded-Encrypted: i=1; AJvYcCVtaKDbO3XAdhNreqOVAp+DYuHqqayoVIaKv2nG43SnRFZzk7DmTQ62CiTv4hWhBnq2RLIUXEqA4YdwHNSD@lists.postgresql.org X-Gm-Message-State: AOJu0YwL4I4qfNtiQHt+Z9kowCqzp4jAK8wZCpRgvgnpTbkOsc+C2/iy tIOZ2RQCFScgq+MxPQP6Q69+TCOcMyebH4TO4MG+Wobm4w5MFcZ7k+L8FLvJ6+A= X-Google-Smtp-Source: AGHT+IFtubX6V+3EPdfjfFvoalxTgHqvsT4yPxdIKN1EWzXAnpjDpUFb71TIOFhXnQfDCiqGXYXdGA== X-Received: by 2002:a17:906:f58e:b0:a80:b016:2525 with SMTP id a640c23a62f3a-a89a2583af0mr938318466b.8.1725285652449; Mon, 02 Sep 2024 07:00:52 -0700 (PDT) Received: from dynamic-pd01.res.v6.highway.a1.net ([2001:871:5e:53f4:c624:8ff4:8180:8ef6]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a89891968e9sm559254666b.120.2024.09.02.07.00.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Sep 2024 07:00:52 -0700 (PDT) Message-ID: <3850a85012d040827b10193189edbe2c23a64f8f.camel@cybertec.at> Subject: Re: proposal: schema variables From: Laurenz Albe To: Pavel Stehule Cc: Erik Rijkers , Michael Paquier , Amit Kapila , DUVAL REMI , PostgreSQL Hackers Date: Mon, 02 Sep 2024 16:00:51 +0200 In-Reply-To: References: <20200924035637.GF28585@paquier.xyz> <20201001033824.GC8130@paquier.xyz> <51a9a68e8a998d04df17417d45c1dbd4@xs4all.nl> <89817942c99da01cd5e7850fe418436b@xs4all.nl> <56ca532c37eb0b540961f74a7bd5db39@xs4all.nl> <8181bd3abc647bdae5a4f78e71e62478a98c75f4.camel@cybertec.at> <9e67d49deb18270eddb95e602c83f02b98459843.camel@cybertec.at> <3b662dc5b615d4c20a55e8e2fbe6fc00fe00609d.camel@cybertec.at> <6996931e8c9edf3b82223e74e92326a7ed06c1d6.camel@cybertec.at> <67aa68a7e6dfb44c0cbbdf7f97cadfede4269ce5.camel@cybertec.at> <04ec666686e9e21cb515617df06885c66f3d34ce.camel@cybertec.at> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.52.4 (3.52.4-1.fc40) MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Thu, 2024-08-29 at 19:33 +0200, Pavel Stehule wrote: > > > > > =C2=A0 > +=C2=A0 =C2=A0/* > > > > > =C2=A0 > +=C2=A0 =C2=A0 * Although svar is freshly validated in t= his point, the svar->is_valid can > > > > > =C2=A0 > +=C2=A0 =C2=A0 * be false, due possible accepting invali= dation message inside domain > > > > > =C2=A0 > +=C2=A0 =C2=A0 * check. Now, the validation is done afte= r lock, that can also accept > > > > > =C2=A0 > +=C2=A0 =C2=A0 * invalidation message, so validation sho= uld be trustful. > > > > > =C2=A0 > +=C2=A0 =C2=A0 * > > > > > =C2=A0 > +=C2=A0 =C2=A0 * For now, we don't need to repeat valida= tion. Only svar should be valid > > > > > =C2=A0 > +=C2=A0 =C2=A0 * pointer. > > > > > =C2=A0 > +=C2=A0 =C2=A0 */ > > > >=20 > > > > This comment is related to assertions. Before I had there `Assert(s= var->is_valid)`, > > > > because I expected it. But it was not always true. And although it = is true, > > > > we don't need to validate a variable, because at this moment, the v= ariable > > > > should be locked, and then we can return content safely. > > >=20 > > > I guess my main problem is the word "trustful".=C2=A0 I don't recogni= ze that word. > > > Perhaps you can reword the comment along the lines of your above expl= anation. > >=20 > >=20 > > I'll try to change it >=20 > is this better >=20 > <-->/* > <--> * Although svar is freshly validated in this point, the svar->is_val= id can > <--> * be false, due possible accepting invalidation message inside domai= n > <--> * check. But now, the variable, and all dependencies are locked, so = we > <--> * don't need to repeat validation. > <--> */ Much better. Here is an improved version: Although "svar" is freshly validated in this point, svar->is_valid can be false, if an invalidation message ws processed during the domain check= . But the variable and all its dependencies are locked now, so we don't nee= d to repeat the validation. Yours, Laurenz Albe