Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mjN8J-0006gN-7n for pgsql-hackers@arkaria.postgresql.org; Sat, 06 Nov 2021 14:57:27 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mjN8H-0002y9-EC for pgsql-hackers@arkaria.postgresql.org; Sat, 06 Nov 2021 14:57:25 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mjN8G-0002xy-Tq for pgsql-hackers@lists.postgresql.org; Sat, 06 Nov 2021 14:57:25 +0000 Received: from mail-io1-xd2b.google.com ([2607:f8b0:4864:20::d2b]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1mjN8A-0003Ix-7a for pgsql-hackers@lists.postgresql.org; Sat, 06 Nov 2021 14:57:23 +0000 Received: by mail-io1-xd2b.google.com with SMTP id n128so14055158iod.9 for ; Sat, 06 Nov 2021 07:57:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telsasoft-com.20210112.gappssmtp.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=Mq1FcJDIZbXw2cAUrhjunVuYwnyALUlLqjVqqdKSIKQ=; b=26NTLp1BqWAcA7esBI7Ah/lyeNssEBXaF7g3yCdsZY7A9icowYRPePqcoXl6z+QuXP B3Le5tToPhDUUbET+0n90DQt2lRY7gGqOmMgjMl5ddzGOOhwi6iSrc3zhhjXvQiAt1ps 4M1B1iIw1Zg7nE9DcnTI7T6nWQFtXbcuPVtfp7VCdyRoRGfB8OyT2KWl+dh6KOu2NOL8 a6dMY6A2vcjeKGEeZCgj0NQElxpSl+55kXaac+XGJ8qKZl8O7SVAL0Z0WzxdhoDCZH9p J6OBTIL+BNIc7Zul/6OyqA+2txRrd3JiG+StIgxvDRaPLGTrzrnSrleXXtN3fWSDECQr VteQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=Mq1FcJDIZbXw2cAUrhjunVuYwnyALUlLqjVqqdKSIKQ=; b=tpXP/PE/BAgUbFgWqsOJP5DK9pRp0yUnz4qvR8yjOlmv9HxxgBdjy5Qll6Kze81Wnb Fu1TZ3imO9xqyCkydFHhnMyoRL7I+oM7HkN00Q7ot8zN7CXyTw3Asq9XqLTSOOvvuK5G RXmnFPZGIjcoOuzbHAxtC5y0VheTHWwBGZ5dAM0Vx/LV4uRuK9dYWhKhjeH0i5FeJQSx sovOC0zT8Hkuq4LV73ZsNwdX4lJdizdAPpUoRcjAHxcLtHbiiu/by8e9dsWsj1i8qPUf rswy1BOrvPKYg+uXYgUNH25h8mU/R5bjxsP1FO2172MPC07zerHmlkRu+7haXWMl0qb3 Q+0w== X-Gm-Message-State: AOAM531vKlkAy6s6zqs4aazACuZZiczX8HqbZTmvv6ujEarvJesRnQAU dB0pFy4gCr0InhsSQTptBN/YyQ== X-Google-Smtp-Source: ABdhPJxL/Tdq5BlI06NBmtiD8KZRO0tWJeG8ek40mhUqWxLg7H/cPN5AJ8CFEhXxd4WmKi7qGgZHuA== X-Received: by 2002:a05:6638:408d:: with SMTP id m13mr12114729jam.41.1636210636988; Sat, 06 Nov 2021 07:57:16 -0700 (PDT) Received: from pryzbyj.telsasoft (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id i16sm5450028ioh.54.2021.11.06.07.57.16 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 06 Nov 2021 07:57:16 -0700 (PDT) Received: by pryzbyj.telsasoft (Postfix, from userid 1000) id 00E69800C97; Sat, 6 Nov 2021 09:57:14 -0500 (CDT) Date: Sat, 6 Nov 2021 09:57:14 -0500 From: Justin Pryzby To: Pavel Stehule Cc: Tomas Vondra , Jaime Casanova , Erik Rijkers , Gilles Darold , PostgreSQL Hackers , Michael Paquier , Amit Kapila , Tomas Vondra , Peter Eisentraut , Tom Lane , Alvaro Herrera , Robert Haas Subject: Re: Schema variables - new implementation for Postgres 15 Message-ID: <20211106145714.GI17618@telsasoft.com> References: <20210912021338.GA21136@ahch-to> <68eedf25-79ca-d0e7-1af6-bad225fdcd97@enterprisedb.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Sat, Nov 06, 2021 at 04:45:19AM +0100, Pavel Stehule wrote: > st 3. 11. 2021 v 14:05 odesílatel Tomas Vondra napsal: > > 1) Not sure why we need to call this "schema variables". Most objects > > are placed in a schema, and we don't say "schema tables" for example. > > And it's CREATE VARIABLE and not CREATE SCHEMA VARIABLE, so it's a bit > > inconsistent. +1 At least the error messages need to be consistent. It doesn't make sense to have both of these: + elog(ERROR, "cache lookup failed for schema variable %u", varid); + elog(ERROR, "cache lookup failed for variable %u", varid); > Yes, there is inconsistency, but I think it is necessary. The name > "variable" is too generic. Theoretically we can use other adjectives like > session variables or global variables and the name will be valid. But it > doesn't describe the fundamentals of design. This is similar to the > package's variables from PL/SQL. These variables are global, session's > variables too. But the usual name is "package variables". So schema > variables are assigned to schemes, and I think a good name can be "schema > variables". But it is not necessary to repeat keyword schema in the CREATE > COMMAND. > > My opinion is not too strong in this case, and I can accept just > "variables" or "session's variables" or "global variables", but I am not > sure if these names describe this feature well, because still they are too > generic. There are too many different implementations of session global > variables (see PL/SQL or T-SQL or DB2). I would prefer "session variable". To me, this feature seems similar to a CTE (which exists for a single statement), or a temporary table (which exists for a single transaction). So "session" conveys a lot more of its meaning than "schema". But don't rename everything just for me... -- Justin