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 1tBExr-002fPE-HC for pgsql-hackers@arkaria.postgresql.org; Wed, 13 Nov 2024 15:07:26 +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 1tBExo-00Evq1-JK for pgsql-hackers@arkaria.postgresql.org; Wed, 13 Nov 2024 15:07:25 +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 1tBExo-00Evpr-5K for pgsql-hackers@lists.postgresql.org; Wed, 13 Nov 2024 15:07:24 +0000 Received: from mail-yb1-xb33.google.com ([2607:f8b0:4864:20::b33]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1tBExi-001gNU-64 for pgsql-hackers@lists.postgresql.org; Wed, 13 Nov 2024 15:07:23 +0000 Received: by mail-yb1-xb33.google.com with SMTP id 3f1490d57ef6-e291cbbf05bso6919479276.2 for ; Wed, 13 Nov 2024 07:07:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1731510437; x=1732115237; 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=bQVeceAU6Y8VIb8tm8KrQlM7SUJjFraUaEBpJrvOdmg=; b=mJoKnGl6nteci0mEwttE/Ihp3c0ZS/LLQ/NyoHrCsdTf5oLprB30inU5T+btgZrebF piMxm6O1M9ve0s8Qge0HHWur+Zi86O5wC7apZm4vyQxr0gF+F4ugPB1FLxWqD0+ODgjM Cym53rNZB5UEeOynYlZNlhQ1JpqJVfxUxy7W0T9mfyLoaGmQdwH/AUYp4Nb6ZzXnCjvZ 5Aj/pprXgWBzXbDGmt1tkP3w1QhYUYrt+FaKS0KgVjvSd+PBSxgC1/Upm/z8e2ENZZ7c Jx9CIoJbbQ7wrIkYWEbhsVlrPz5+ZiSMxUJudZd319SCRzWBcKSLPXElm/VlhS4pjQ71 gyoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731510437; x=1732115237; 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=bQVeceAU6Y8VIb8tm8KrQlM7SUJjFraUaEBpJrvOdmg=; b=rt/39O2jg+6cC45gX59Bq1lo0SY3ROVP7NOQpN/vDmhmMRXb4pRy3hLXpp0CwJYkWG DPCbxxDSxRxXVqhHNW0s+Ha4cZsdeAr96YWKoMbjRk7wsS9fg2wym+abBxkztoxOSVzm eItwzaLcRhXXQHJ86PIYAgmOxHKoe/YYydfS+IHt7vEPtjCAGtxyISUxjRHZmr2Hc2Ya uJQrsOcd64S6R2PPlUW57FlD+/5Nrr/bC+3lBCn28qkwgft3kzz8I2SYejSJeLh4VOAN urnSgxdZ2jeX5tLfzdbpJB1DB17uhBSNRxXyGggbhQ3OecBwSozbSMt53F8XXqIHcmh7 2wBw== X-Forwarded-Encrypted: i=1; AJvYcCX63Kbn+a84mhuMze/qr9iWEwLw06gLUrGWC62djNF4hx2kxE91PkWZ49KK6mQaBKdAHGzRjNs4u8Tz1LIJ@lists.postgresql.org X-Gm-Message-State: AOJu0Yw8g7MgwgndRPIhvjVHA28tZP6nIafDUIXz/E7lW1D6pW9hzqvt sKuVgs6MPER9VVr8bAxQTM8SInoH3MaiSDzpYi/mQ/lyRKG3vzVwPfUnv3tiqAtFC1HmPHTFvce 950Cc0ev4bXgng/WSXUADhYmg0P0= X-Google-Smtp-Source: AGHT+IECUmchnc4pLq8Ac8PJ31ZUu20Y92UzWH/OfFQfZrY8tqkeUh24iq23wrs4DaaaDmc0ixkYUCwcKbJjnuuR71Q= X-Received: by 2002:a05:6902:18ca:b0:e30:78c0:83aa with SMTP id 3f1490d57ef6-e35ecf1dc70mr3122970276.3.1731510437325; Wed, 13 Nov 2024 07:07:17 -0800 (PST) MIME-Version: 1.0 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> <3850a85012d040827b10193189edbe2c23a64f8f.camel@cybertec.at> <8842f664d3b4c909d97fd56d374d899fac9a5b84.camel@cybertec.at> In-Reply-To: <8842f664d3b4c909d97fd56d374d899fac9a5b84.camel@cybertec.at> From: Pavel Stehule Date: Wed, 13 Nov 2024 16:06:37 +0100 Message-ID: Subject: Re: proposal: schema variables To: Laurenz Albe Cc: Erik Rijkers , Michael Paquier , Amit Kapila , DUVAL REMI , PostgreSQL Hackers Content-Type: multipart/alternative; boundary="0000000000008ab0bc0626ccb0e2" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000008ab0bc0626ccb0e2 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable st 13. 11. 2024 v 15:24 odes=C3=ADlatel Laurenz Albe napsal: > Thanks for the updated patch set. > > Here is my review of patch 0005: > > > --- a/src/backend/access/transam/xact.c > > +++ b/src/backend/access/transam/xact.c > > +#include "commands/session_variable.h" > > You probably forgot to move that to the patch for temporary variables. > I did that. > +1 > > --- a/src/backend/commands/session_variable.c > > +++ b/src/backend/commands/session_variable.c > > @@ -83,6 +92,19 @@ static HTAB *sessionvars =3D NULL; /* hash table for > session variables */ > > > > static MemoryContext SVariableMemoryContext =3D NULL; > > > > +/* true after accepted sinval message */ > > +static bool needs_validation =3D false; > > + > > +/* > > + * The content of session variables is not removed immediately. When i= t > > + * is possible we do this at the transaction end. But when the > transaction failed, > > + * we cannot do it, because we lost access to the system catalog. So w= e > > + * try to do it in the next transaction before any get or set of any > session > > + * variable. We don't want to repeat this opening cleaning in > transaction, > > + * So we store the id of the transaction where opening validation was > done. > > + */ > > +static LocalTransactionId validated_lxid =3D InvalidLocalTransactionId= ; > > I have moved the reference to the transaction end to the temporary variab= le > patch. > +1 > I have gone over the comments in patch 0005 and 0006. > I hope I got everything right. Attached is an updated patch set. > Thank you Pavel > > Yours, > Laurenz Albe > --0000000000008ab0bc0626ccb0e2 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
st 13. 11. 2024 v=C2=A015:24 odes=C3= =ADlatel Laurenz Albe <laure= nz.albe@cybertec.at> napsal:
Thanks for the updated patch set.

Here is my review of patch 0005:

> --- a/src/backend/access/transam/xact.c
> +++ b/src/backend/access/transam/xact.c
> +#include "commands/session_variable.h"

You probably forgot to move that to the patch for temporary variables.
I did that.

+1


> --- a/src/backend/commands/session_variable.c
> +++ b/src/backend/commands/session_variable.c
> @@ -83,6 +92,19 @@ static HTAB *sessionvars =3D NULL; /* hash table fo= r session variables */
>=C2=A0
>=C2=A0 static MemoryContext SVariableMemoryContext =3D NULL;
>=C2=A0
> +/* true after accepted sinval message */
> +static bool needs_validation =3D false;
> +
> +/*
> + * The content of session variables is not removed immediately. When = it
> + * is possible we do this at the transaction end. But when the transa= ction failed,
> + * we cannot do it, because we lost access to the system catalog. So = we
> + * try to do it in the next transaction before any get or set of any = session
> + * variable. We don't want to repeat this opening cleaning in tra= nsaction,
> + * So we store the id of the transaction where opening validation was= done.
> + */
> +static LocalTransactionId validated_lxid =3D InvalidLocalTransactionI= d;

I have moved the reference to the transaction end to the temporary variable=
patch.

+1


I have gone over the comments in patch 0005 and 0006.
I hope I got everything right.=C2=A0 Attached is an updated patch set.
<= /blockquote>

Thank you

Pavel
=C2=A0

Yours,
Laurenz Albe
--0000000000008ab0bc0626ccb0e2--