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 1kzzuw-0005qe-5R for pgsql-hackers@arkaria.postgresql.org; Thu, 14 Jan 2021 10:31:50 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kzzuv-0006bI-1S for pgsql-hackers@arkaria.postgresql.org; Thu, 14 Jan 2021 10:31:49 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kzzuu-0006bB-Ne for pgsql-hackers@lists.postgresql.org; Thu, 14 Jan 2021 10:31:48 +0000 Received: from mail-lf1-x134.google.com ([2a00:1450:4864:20::134]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1kzzus-0005Je-1i for pgsql-hackers@lists.postgresql.org; Thu, 14 Jan 2021 10:31:48 +0000 Received: by mail-lf1-x134.google.com with SMTP id o19so7342082lfo.1 for ; Thu, 14 Jan 2021 02:31:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=tG1hSi77DhMGsgIx+cRQy9Fp6breFeH3XNhFolDtcnw=; b=fLQXlXZa3AxRMu5Ld3GPuzsG0/W7ZhySzvEnTCrn3hsZF5unF6qd/lmne9tmwnXCig tuWCDtPm9+ANjn6OcoQQ97Z1/Wlou1deb1FO4m+VjDLjrR10SZapTxeOr49Gk4pGLPoa WzYqd2wl9Iphl7cX7mjZfkP0NRY9yKD9x+tUsvIjDNDVJz53A/+ogqcY8UtjHk26WLtp Jykx10fkXS68VYmEfpuhxPzwUaM3PNhAvukpiqnwZWpbzhELv/qyaZa5NE/FTReCgHLB QZEvcRtlLt2IhRtoh2hereWoM7Ht78QrcTL7UdOGWmar6aZoYNDoIdjHO7zdGVnvObnO fRcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=tG1hSi77DhMGsgIx+cRQy9Fp6breFeH3XNhFolDtcnw=; b=bfRvGDsyr3w4Yjbyn66oxRqAjZPwrlsi5cMvEdLLJExrHHT2KlPlTO6lfl6GgmD09c 3Xqfb5//4LpFk7ysRbHnlVv/zNZonFdhmQJuCJzVPkKR1KppIU65Caivu26HzfHWpQgR 8IAMpA/HJFwXGzNl58BwS+qK7ZQ9MJ4vuJ98Kzzc8LqaaeQBeAmXI/qvZDdK3MkF2QA1 TcZV/qwPefO8POcN19YdH7VzLFbdZh80HwHPtV8owpYG2aJRWucGDIb17QV/sly1VY2k bxp53rt++QwXnj6Ub/TGafFHEpeNVwDilcM6xA/ThhK/aoi9z982pp+eynN3mpW9Pgsu O7Bw== X-Gm-Message-State: AOAM5308JMfeIyBivZhvraycHPLT0n5XTpdmuCb7p0PBhjhhcnx9WRQS U1Yl0UmzCPj2Rxum00q/gOb4+SD5elsvg6vsHK4= X-Google-Smtp-Source: ABdhPJwF3ZwSh4Y6tVOMD5k76BFqa2CRLB0I8IATWVoXeOD0Hj3t9aatyj0TWS5MxFDrtk7JmIA+NlQPKwNgO6IIBCk= X-Received: by 2002:a19:e20a:: with SMTP id z10mr3305985lfg.295.1610620304973; Thu, 14 Jan 2021 02:31:44 -0800 (PST) MIME-Version: 1.0 References: <20200924035637.GF28585@paquier.xyz> <20201001033824.GC8130@paquier.xyz> <51a9a68e8a998d04df17417d45c1dbd4@xs4all.nl> In-Reply-To: From: =?UTF-8?B?Sm9zZWYgxaBpbcOhbmVr?= Date: Thu, 14 Jan 2021 11:31:33 +0100 Message-ID: Subject: Re: proposal: schema variables To: Pavel Stehule Cc: Erik Rijkers , Michael Paquier , Zhihong Yu , Amit Kapila , DUVAL REMI , PostgreSQL Hackers Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk I did some testing locally. All runs smoothly, compiled without warning. Later on (once merged) it would be nice to write down a documentation page for the whole feature as a set next to documented individual commands. It took me a few moments to understand how this works. I was looking how to create variable with non default value in one command, but if I understand it correctly, that's not the purpose. Variable lives in a schema with default value, but you can set it per session via LET. Thus "CREATE VARIABLE" statement should not be usually part of "classic" queries, but it should be threatened more like TABLE or other DDL statements. On the other side LET is there to use the variable in "classic" queries. Does that make sense? Feel free to ping me if any help with documentation would be needed. I can try to prepare an initial variables guide once I'll ensure I do understand this feature well. PS: Now it is clear to me why it is called "schema variables", not "session variables". =C4=8Dt 14. 1. 2021 v 7:36 odes=C3=ADlatel Pavel Stehule napsal: > > Hi > > rebase > > Regards > > Pavel >