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 1tCJto-00GL2R-9e for pgsql-hackers@arkaria.postgresql.org; Sat, 16 Nov 2024 14:35:43 +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 1tCJtl-00EVWQ-Fl for pgsql-hackers@arkaria.postgresql.org; Sat, 16 Nov 2024 14:35:42 +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 1tCJtl-00EVWI-5V for pgsql-hackers@lists.postgresql.org; Sat, 16 Nov 2024 14:35:41 +0000 Received: from mail-yw1-x112c.google.com ([2607:f8b0:4864:20::112c]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1tCJti-002GcQ-DG for pgsql-hackers@lists.postgresql.org; Sat, 16 Nov 2024 14:35:41 +0000 Received: by mail-yw1-x112c.google.com with SMTP id 00721157ae682-6ee40e83288so33177007b3.1 for ; Sat, 16 Nov 2024 06:35:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1731767737; x=1732372537; 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=P2iSHbvmqv9PjUCD+fq4WxVUbbQOdnBKviVPIBgfb4A=; b=fRCsZ731NQSW/sE/HTIKy1JC3CouYur6HDQG3oqCPmnZEHjFb53F0jQG4QlFsOzQIq Y3Gph7OWSrwjj4rnMnnDNJPdO1en905qbkwNmG371P0mxVwhKw5bn5+tAKRVG4j8bRaH 2C84OXF2dls4yMWWwA5Dks5yYC44YBuok/qzV/o53aXNXKTUagN3YMXGEgIbgt87BRdM jJsul9eNHMSeHbgXGf9yzZB8PRMn//linVuCCcEj9XIa4KS0U67dSEQwu8b/KFGOK0iW Q35Y/Pyx5IAu7Z+WX7YM+tF9J9AP3SHhkCxTf1L43vM8i7gYzsE7m5EonODMB8al0Y8u W4Ug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731767737; x=1732372537; 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=P2iSHbvmqv9PjUCD+fq4WxVUbbQOdnBKviVPIBgfb4A=; b=bko8TcBcGtqJ/EgT9XlMpYLI09vJC4yS9jL8Yi9CcmNCkL+3j7URhk2ctbSTD0LnFF yEQB7cGkmsG0e1ZuBs0XThxbeuD6JZDVuYoNfjy7TkstonsZlPzbPUdyusOV/jij1zzr 9938OtjaAmyg+eHF5+9pdaFx4HUcC99Gi1U4/3+f3wuR24pODVIX4I+RH+A5cT8Go4jE 3hz0x2LBUqkzBcI0MU4BqAH/qt+rrC8Gjfdnv9HZZjvPqD/whtsSuOfxls7szhhBnnQq 91wB8pG6no4jVaTJovEOTvoVko5Oim+e+AR3nkxUxkvjejyFCXz7AYLcugm7l6OKwPbB M/+g== X-Forwarded-Encrypted: i=1; AJvYcCWVlwrA9y5papmIgGJmnJ65n6B4kfpXVlA3gTSjnkIFswlHXCK7vPSJAPAcF7AK9xq3cM7el4FPvmgqUaWF@lists.postgresql.org X-Gm-Message-State: AOJu0YzupL5aDAPyjV/muhK3Ay4th5kMz0k5BpAuxYpr36+P5Sp1exlM QylN4R0EgUGjEmiBqkBsH9PJsPrtXyMuCuUHSP6hUQJrt2hXrPi5xk6CAwAWOYcg4tVXzpnDxMU i8tQ7kdE9Dvil5my6cK1jGkSq+o4= X-Google-Smtp-Source: AGHT+IHKoj5ghWJjRyk2EIhyJkAJ8e3gOF0dk5ErBeZigHoYFlaVi5k9HuAHeqN0BerI3VJ+1akXBvxFiVtmGeWiRCY= X-Received: by 2002:a05:690c:7307:b0:6ea:8ebb:1f9e with SMTP id 00721157ae682-6ee55c57eb7mr70469147b3.36.1731767737523; Sat, 16 Nov 2024 06:35:37 -0800 (PST) MIME-Version: 1.0 References: <3chredgnjcmccym2kczawfih226b4ac6co7p6z4jeofevrcosi@mrsxkx2x2c65> In-Reply-To: From: Pavel Stehule Date: Sat, 16 Nov 2024 15:34:58 +0100 Message-ID: Subject: Re: proposal: schema variables To: Dmitry Dolgov <9erthalion6@gmail.com> Cc: Laurenz Albe , Erik Rijkers , Michael Paquier , Amit Kapila , DUVAL REMI , PostgreSQL Hackers Content-Type: multipart/alternative; boundary="000000000000d42a4d0627089893" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000d42a4d0627089893 Content-Type: text/plain; charset="UTF-8" Hi > As a side note, I've recently caught myself thinking "it would be cool to > have > session variables here". The use case was preparing a policy for RLS, > based on > some session-level data set by an application. This session-level data is > of a > composite data type, so simple current_setting is cumbersome to use, and a > temporary table will be dropped at the end, taking the policy with it due > to > the recorded dependency between them. Thus a session variable of some > composite > type sounds like a good fit. > yes, RLS support is one mentioned use case, and strong reason the access rights are implemented there. Regards Pavel --000000000000d42a4d0627089893 Content-Type: text/html; charset="UTF-8"
Hi


As a side note, I've recently caught myself thinking "it would be cool to have
session variables here". The use case was preparing a policy for RLS, based on
some session-level data set by an application. This session-level data is of a
composite data type, so simple current_setting is cumbersome to use, and a
temporary table will be dropped at the end, taking the policy with it due to
the recorded dependency between them. Thus a session variable of some composite
type sounds like a good fit.

yes, RLS support is one mentioned use case, and strong reason the access rights are implemented there.

Regards

Pavel
--000000000000d42a4d0627089893--