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 1tRmk7-00BfnW-Vv for pgsql-hackers@arkaria.postgresql.org; Sun, 29 Dec 2024 06:25:40 +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 1tRmk5-004bzf-76 for pgsql-hackers@arkaria.postgresql.org; Sun, 29 Dec 2024 06:25:36 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tRmk4-004bzX-QS for pgsql-hackers@lists.postgresql.org; Sun, 29 Dec 2024 06:25:36 +0000 Received: from mail-yb1-xb36.google.com ([2607:f8b0:4864:20::b36]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1tRmk1-0029Fp-Qq for pgsql-hackers@lists.postgresql.org; Sun, 29 Dec 2024 06:25:35 +0000 Received: by mail-yb1-xb36.google.com with SMTP id 3f1490d57ef6-e3a0d2d15adso9168016276.0 for ; Sat, 28 Dec 2024 22:25:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1735453532; x=1736058332; 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=nNFCwsSxClTYOzSZ8HtY/kVqiSTqqtjs/dnvmP2qq28=; b=OFZag1X7eyyfSPehZ09MNBvNWc2PvkOmRmzdQn0nvKWOHYAQFCUmrakt9/WyAj7YAr bEGVholPZ1LeCI7jTKDPH6CFIXJ3iH+ZYajuBbTVKyzpGPBbgaxtzqmWZcvdmRxsA+lM bFOGsw1vB4UguI8yrQKMZCTAAL3susbc20/SBD7vTPW83tXoIpHDLlKuBQN5/CH0+dGM Er9JR8/DDyC863SC9aeQAS4oE591gHiaywLXO8kbhqEdiwSSxyqXroXjE7hUtX2c0eO/ m6jNBfdyHV5ApzrB9Y9yBIYMm3QyjGYm9NE6oP+mGZgzrxf2e/SlxhMPg186u/SFB5Ck QByg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735453532; x=1736058332; 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=nNFCwsSxClTYOzSZ8HtY/kVqiSTqqtjs/dnvmP2qq28=; b=e/eCbnyNqnQx+oi5BVH/DDD6VHcYW8gunGzIjAY0PzuRsrhriv8apFJ6NYdSd3Dfvj jhBiMUBccVTQhaj4reFHZPh2OfHQKuM7Ar1t5w6FvEZ7P/Ns5rTpTcTxpFeTiURyeqYL x8bMKeu2WDeHmjek+SKSQ8cFxt9HwdOsK/RAAD7+f8SGhMbYbzeQliuHq2BsRRWw+ZLg 6G17VUsvoWAiRTrbUwGTysRRo3xD6CCX8B9uRhi4h7yeS8AQ6Yw/BsvqKawmqqmySjUY Qtnwt1R+q25ldufjw+iHC3K2Ynn1A+vDoI4054xkQUNVc8EYG1sNsxaSwwpfjUHGvL4T Q52Q== X-Forwarded-Encrypted: i=1; AJvYcCWNzn3frTvOgHs40g5xp6UzpDazFJvCMUigWgKJ92Cm2OJmr9tHQDNwN3Wg67bVRPZ6Wk+W+HftcnCbQSJG@lists.postgresql.org X-Gm-Message-State: AOJu0YxXNvNOO0lcbc+8xr0BHbCyzJ9V3dmVgprp6IWxAFrvlj7NRzIo 2j+PN4dmes2980GHLO9HYhmWxALIan9kfh/nCTFRUjuxg4H3jMOF9dXKWHHYscLW5w8xPGxZKnq VDNGKzZ8rOqncKu2qjd+Yavx0nOw= X-Gm-Gg: ASbGncsK87y9cceTcQbFh5NX1TQY1Z+4+Pw8PCMi69XvZK/DM8ZWaCUXa4yophiK5ua 3obA5eOuALoZIEcDRkilviiArqtMhwua8eABvRD8icnkvrczqvu7NZffCbm1Ny1xsEGu2gOc= X-Google-Smtp-Source: AGHT+IGSOtzg5MjUMe6PdMyOXS8dNl3NQ3+bXLl2hEtV2dTLguYnl6a98nKVCyKS+sBc5DWvmRJYFc2DXrHzFCF5yYs= X-Received: by 2002:a05:690c:498b:b0:6e3:fd6:6ccb with SMTP id 00721157ae682-6f3f811016cmr241286067b3.13.1735453532347; Sat, 28 Dec 2024 22:25:32 -0800 (PST) MIME-Version: 1.0 References: <3chredgnjcmccym2kczawfih226b4ac6co7p6z4jeofevrcosi@mrsxkx2x2c65> <20241120201313.t4wbhld4ktgielaf@erthalion.local> In-Reply-To: From: Pavel Stehule Date: Sun, 29 Dec 2024 07:24:55 +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="00000000000051e7c3062a62c313" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --00000000000051e7c3062a62c313 Content-Type: text/plain; charset="UTF-8" Hi >> + { >> + /* the last field of list can be star too */ >> + Assert(IsA(field2, A_Star)); >> + >> + /* >> + * In this case, the field1 should be variable name. But >> + * direct unboxing of composite session variables is not >> + * supported now, and then we don't need to try lookup >> + * related variable. >> + * >> + * Unboxing is supported by syntax (var).* >> + */ >> + return InvalidOid; >> + } >> I don't fully understand the above comments, >> > > The parser allows only two syntaxes - identifier.identifier or > identifier.star. Second > syntax is not supported by session variables, and then I didn't try to > search for the variable. > Some users can be confused by similar syntaxes identifier.* and > (identifier).* Only > second syntax is composite unboxing, and only second syntax is supported > for > session variables. > > I changed this comment to <--><--><--><--><-->/* <--><--><--><--><--> * The syntax ident.* is used only by table aliases, <--><--><--><--><--> * and then this identifier cannot be a reference to <--><--><--><--><--> * session variable. <--><--><--><--><--> */ --00000000000051e7c3062a62c313 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi


+ {
+ /* the last field of list can be star too */
+ Assert(IsA(field2, A_Star));
+
+ /*
+ * In this case, the field1 should be variable name. But
+ * direct unboxing of composite session variables is not
+ * supported now, and then we don't need to try lookup
+ * related variable.
+ *
+ * Unboxing is supported by syntax (var).*
+ */
+ return InvalidOid;
+ }
I don't fully understand the above comments,

<= /div>
The parser allows only two syntaxes - identifier.identifier or id= entifier.star. Second
syntax is not supported by session variable= s, and then I didn't try to search for the variable.
Some use= rs can be confused by similar syntaxes identifier.* and (identifier).* Only=
second syntax is composite unboxing, and only second syntax is s= upported for
session variables.


I changed this comment to

<= ;--><--><--><--><-->/*
<--><-->&l= t;--><--><--> * The syntax ident.* is used only by table ali= ases,
<--><--><--><--><--> * and then this= identifier cannot be a reference to
<--><--><--><-= -><--> * session variable.
<--><--><--><--= ><--> */
=C2=A0
--00000000000051e7c3062a62c313--