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 1tUjvs-002IAr-Jx for pgsql-hackers@arkaria.postgresql.org; Mon, 06 Jan 2025 10:02: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 1tUjvr-007HlQ-HI for pgsql-hackers@arkaria.postgresql.org; Mon, 06 Jan 2025 10:01:59 +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 1tUjvr-007Hkj-3q for pgsql-hackers@lists.postgresql.org; Mon, 06 Jan 2025 10:01:58 +0000 Received: from mail-yb1-xb31.google.com ([2607:f8b0:4864:20::b31]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1tUjvo-0008Di-2E for pgsql-hackers@lists.postgresql.org; Mon, 06 Jan 2025 10:01:57 +0000 Received: by mail-yb1-xb31.google.com with SMTP id 3f1490d57ef6-e46ebe19489so17910743276.2 for ; Mon, 06 Jan 2025 02:01:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1736157716; x=1736762516; 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=NAPPJ1bYB54RddD9ouGK4STXD9nbplkJWjYapaHWkzQ=; b=JqE2nTWkNYRoVRyVw3U9r23HhihZGuRS1gJpeUwJwwbFtPhVF/aY9Yp9KwIbMG1kBn Q4ZaZk2JPZomnZ3N4Yp553n3UWjcyXDZNGaTMH+EVQ2JiHqWM/bh8an0bwUgj8p0mtFk S6pU7GTzNiRYuPzx16tv3/6isOldSgFlaiACRwfSdMbIcHNCOzxOAZOFOVCe9Uw5RAx8 7dwqenj/edXFvtroa9O1K4LjaWhZF+6yXmSIZJ6CDOADtC/Xx3AjBQV/nZkO031Rg9H5 5cPxlwumasvx10XG11iY0EimI/Jwyrf49bEN6IvFDB+tEFo1K3hs348EH6o+dgi68228 33+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736157716; x=1736762516; 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=NAPPJ1bYB54RddD9ouGK4STXD9nbplkJWjYapaHWkzQ=; b=JpWgHRSdmVfur8hU8KRayYJ1J/+ivehXfi/vLJnUeFMySJ+IWepOH54bydG/sFe1Cr mSQfVL5j/SmdNv/z6qNSjNrag2+QGxqARsu6loXnICE2n4RITSwBMcZMBjChvBbvrRQ1 XYDX5dGW7VxAGXA5/vFEWfjb8zca06jLehN3C2OjVnWywKGgZRip2lKZ9L4P8mQFjIi2 pMXrbLxcgbI54cl/2FqJR/l37z1jDmuMlgtDa4XeVWWHenxc3Mzmw02a3E0wxEImCyFj 1sxywLFhKYihBZwvXA2KTYqWEp6E8WMeFiEALhdyTt7sfaI7bQ83FGiOhBFIZASJNB9h OKUQ== X-Forwarded-Encrypted: i=1; AJvYcCXLVAuLVhPakR31dqE7CFj9OCVvOI9pOYOCjkJ7+WiP4jzgGVNQWLd8az9UFZ8Nx5BZdot/MPH2LxP9CvbP@lists.postgresql.org X-Gm-Message-State: AOJu0YxotjH3YuryLaMI+8aPpjtvWLwVBJfvSOgotT/qbfSiDCwaiXKt FwMnYG0+ScXb85y9pyfrOSBcppsyoV9ldbTDhYmtLTfa1jJLUkqvz6PtF4fNII2GvMjY9Y2/+CY iMb4DeoWeOfqbosmaE9NDT+4+65M= X-Gm-Gg: ASbGncv0RrbfCMkMlxdQw5JPrQuGw8eobEbtTbbqS2xZTXQiILKAI9BsDRWNHqtKMRG uPemTtjK7XFIoZxTDbSHEDPdp8ZAtzoEcDLhrlKhLlFCZIQV2mAKJTn9oic6AArvcqC4JSvg= X-Google-Smtp-Source: AGHT+IGBvkNWk55Cx81khcSWyjxV+/ZRxEB09PHKb1346+AscpQShma4GWQg6v+vRxMRjA0LrKCce23lRdsH5nlcn9A= X-Received: by 2002:a05:690c:498b:b0:6e3:fd6:6ccb with SMTP id 00721157ae682-6f3f811016cmr431403577b3.13.1736157716329; Mon, 06 Jan 2025 02:01:56 -0800 (PST) MIME-Version: 1.0 References: <3chredgnjcmccym2kczawfih226b4ac6co7p6z4jeofevrcosi@mrsxkx2x2c65> <20241120201313.t4wbhld4ktgielaf@erthalion.local> In-Reply-To: From: Pavel Stehule Date: Mon, 6 Jan 2025 11:01:17 +0100 Message-ID: Subject: Re: Re: proposal: schema variables To: jian he Cc: Dmitry Dolgov <9erthalion6@gmail.com>, Laurenz Albe , Erik Rijkers , Michael Paquier , Amit Kapila , DUVAL REMI , PostgreSQL Hackers Content-Type: multipart/alternative; boundary="000000000000f4bc1c062b06b75e" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000f4bc1c062b06b75e Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable ne 5. 1. 2025 v 17:11 odes=C3=ADlatel jian he napsal: > + /* > + * The arguments of EXECUTE are evaluated by a direct expression > + * executor call. This mode doesn't support session variables yet. > + * It will be enabled later. > + */ > + if (pstate->p_hasSessionVariables) > + elog(ERROR, "session variable cannot be used as an argument"); > > it should be: > /* > * The arguments of CALL statement are evaluated by a direct expressi= on > * executor call. This path is unsupported yet, so block it. > */ > if (pstate->p_hasSessionVariables) > ereport(ERROR, > errcode(ERRCODE_FEATURE_NOT_SUPPORTED), > errmsg("session variable cannot be used as an argument"))= ; > > done > > similarly, EvaluateParams we can change it to > /* > * The arguments of EXECUTE are evaluated by a direct expression > * executor call. This mode doesn't support session variables yet. > * It will be enabled later. > */ > if (pstate->p_hasSessionVariables) > ereport(ERROR, > errcode(ERRCODE_FEATURE_NOT_SUPPORTED), > errmsg("session variable cannot be used as an argument"))= ; > done > > in src/backend/executor/execExpr.c > we don't need > +#include "catalog/pg_variable.h" > ? > moved to patch 16 --000000000000f4bc1c062b06b75e Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


ne 5. 1. 2025 v= =C2=A017:11 odes=C3=ADlatel jian he <jian.universality@gmail.com> napsal:
+ /*
+ * The arguments of EXECUTE are evaluated by a direct expression
+ * executor call.=C2=A0 This mode doesn't support session variables ye= t.
+ * It will be enabled later.
+ */
+ if (pstate->p_hasSessionVariables)
+ elog(ERROR, "session variable cannot be used as an argument");<= br>
it should be:
=C2=A0 =C2=A0 /*
=C2=A0 =C2=A0 =C2=A0* The arguments of CALL statement are evaluated by a di= rect expression
=C2=A0 =C2=A0 =C2=A0* executor call.=C2=A0 This path is unsupported yet, so= block it.
=C2=A0 =C2=A0 =C2=A0*/
=C2=A0 =C2=A0 if (pstate->p_hasSessionVariables)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 ereport(ERROR,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 errcode(ERRCODE_FEA= TURE_NOT_SUPPORTED),
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 errmsg("sessio= n variable cannot be used as an argument"));

done
=C2=A0

similarly, EvaluateParams we can change it to
=C2=A0 =C2=A0 /*
=C2=A0 =C2=A0 =C2=A0* The arguments of EXECUTE are evaluated by a direct ex= pression
=C2=A0 =C2=A0 =C2=A0* executor call.=C2=A0 This mode doesn't support se= ssion variables yet.
=C2=A0 =C2=A0 =C2=A0* It will be enabled later.
=C2=A0 =C2=A0 =C2=A0*/
=C2=A0 =C2=A0 if (pstate->p_hasSessionVariables)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 ereport(ERROR,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 errcode(ERRCODE_FEA= TURE_NOT_SUPPORTED),
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 errmsg("sessio= n variable cannot be used as an argument"));

=
done
=C2=A0

in src/backend/executor/execExpr.c
we don't need
+#include "catalog/pg_variable.h"
?

moved to patch 16
=C2=A0
--000000000000f4bc1c062b06b75e--