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 1sjjiP-003SoY-U5 for pgsql-hackers@arkaria.postgresql.org; Thu, 29 Aug 2024 18:17:50 +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 1sjjiO-005fCt-2n for pgsql-hackers@arkaria.postgresql.org; Thu, 29 Aug 2024 18:17:48 +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 1sjjiN-005fCl-LH for pgsql-hackers@lists.postgresql.org; Thu, 29 Aug 2024 18:17:48 +0000 Received: from mail-yw1-x1133.google.com ([2607:f8b0:4864:20::1133]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1sjjiL-0023Lz-Ib for pgsql-hackers@lists.postgresql.org; Thu, 29 Aug 2024 18:17:46 +0000 Received: by mail-yw1-x1133.google.com with SMTP id 00721157ae682-699ac6dbf24so9312637b3.3 for ; Thu, 29 Aug 2024 11:17:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1724955464; x=1725560264; 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=pB6ylizjc9J692MW7gr/LBEiagUYMKJ9tAqu4UQoBFA=; b=RNlK1GPYBaAqquOokuDpNkfp9Ol3ImZLTkhF/fk7PuYVIr0avF5tMDz5Ibaqw3aPAm gpwjCnPcbF5uk5drmY6RmRGVkNIMBFVfh8JCE4+bG3/+VAteUZkm0dprNDjYEkLpHWN8 qfPjfvIyTqVG9KczvKFCExLOj1Kfz/r62PDGJ6f+x9ZMSpSwi4gcFInwHdgc+Pfv8cPI CVvlAiqgX3B3s5qD2RQTSWQ1SOrUHKjHplcUaC6CXoBrFCiHW7bTT7gZ0eVUckbrKl+k tCxDjGVebEacVJMKBupeVyEIsp1KbCxo4EQ1OzK7Y+i2Bext5b/xIwrmhYlJkvEOGEjv IdAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724955464; x=1725560264; 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=pB6ylizjc9J692MW7gr/LBEiagUYMKJ9tAqu4UQoBFA=; b=VObxzwCSYQ03HxIeOCZIXP3lgKf5VzJ3YiragodGjGU65Eh1B+LGBfQ5D3c1Yf+h1L /5XtOuHjsvNDI8/gNzNSrmo0JoHM9DbkWupaS2FaeerfS05q6h2SVaaVcM7rQaBHFOWI NDkQ1PICanEbCEE/NGYeQwn0871N2F31DQdMxxZyqYb+UFp5CUXp3DAFKSe7087VZKnq ZgkJfzwEhDZKY8ArdRDj7R7yTbf5vKcR9T4VN4x6BldYqnmjDYDKlugA+zasyE02f4O8 HF3x7cG+PInqsho990RHM3HSWbdVg3MSOyfbShXsJL5al8m+BnkWpxkkncOB18INrYm5 4HoA== X-Forwarded-Encrypted: i=1; AJvYcCV0k+KTVKXbTDvgNrhNtX54J+7+dP0nwS/mSuHaRIiP0D0vLbFSqFpAhqCVOp4QaI8HPVUjuZta9dxJ8EwF@lists.postgresql.org X-Gm-Message-State: AOJu0YyTDH+jTqeGTL7TDhjV00hRGq/KQtYzfUHXvy0re/luAw8MhQpq MvP69Lkq481PCH+tZ4fRVuva+UhBQT6PmPsjrXoHXiK/zQJJpCJXTTFBkMTfoXBTlB3m63xuVun s/NaBQ7+LM6scuhuaiCQa3UYH1H0= X-Google-Smtp-Source: AGHT+IEvG0wkSSJUihYiGN/tgDmifPe60Exn6vSHK0hxgcmn1rEa8WJuFQm7GXX8BYrO4TJSAwS4jYi9sG/+Ywo0WtM= X-Received: by 2002:a05:690c:f07:b0:669:e266:2c55 with SMTP id 00721157ae682-6d275d3e111mr46600827b3.5.1724955463728; Thu, 29 Aug 2024 11:17:43 -0700 (PDT) MIME-Version: 1.0 References: <20200924035637.GF28585@paquier.xyz> <20201001033824.GC8130@paquier.xyz> <51a9a68e8a998d04df17417d45c1dbd4@xs4all.nl> <89817942c99da01cd5e7850fe418436b@xs4all.nl> <56ca532c37eb0b540961f74a7bd5db39@xs4all.nl> <8181bd3abc647bdae5a4f78e71e62478a98c75f4.camel@cybertec.at> <9e67d49deb18270eddb95e602c83f02b98459843.camel@cybertec.at> <3b662dc5b615d4c20a55e8e2fbe6fc00fe00609d.camel@cybertec.at> <6996931e8c9edf3b82223e74e92326a7ed06c1d6.camel@cybertec.at> <67aa68a7e6dfb44c0cbbdf7f97cadfede4269ce5.camel@cybertec.at> <04ec666686e9e21cb515617df06885c66f3d34ce.camel@cybertec.at> <6114b2c070485a96156d6fb116bdb0ec0b11d8ca.camel@cybertec.at> In-Reply-To: <6114b2c070485a96156d6fb116bdb0ec0b11d8ca.camel@cybertec.at> From: Pavel Stehule Date: Thu, 29 Aug 2024 20:17:06 +0200 Message-ID: Subject: Re: proposal: schema variables To: Laurenz Albe Cc: Erik Rijkers , Michael Paquier , Amit Kapila , DUVAL REMI , PostgreSQL Hackers Content-Type: multipart/alternative; boundary="000000000000ab44fc0620d67dd2" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000ab44fc0620d67dd2 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi =C3=BAt 27. 8. 2024 v 16:52 odes=C3=ADlatel Laurenz Albe napsal: > time""On Tue, 2024-08-27 at 08:52 +0200, Pavel Stehule wrote: > > I can throw 200KB from another 300KB patch set which can be better for > review, but it > > can be harder to maintain this patch set. I'll try it, and I'll send a > reduced version. > > That was not a criticism, and I think the way you split up the patch set > right now > is as good as it probably gets. Ideally, one could say something like "w= e > need at least > patch 1 to 4, 5 and 6 are optional, but desirable, all others can easily > be deferred > to a later time". > It was mentioned here more times (I thought). 1..4 are fundamental 5..6 optional (6 are just tests) others can be deferred (5-6 can be deferred too). Without support of temporary session variables, it is not too probable to repeatedly CREATE, DROP the same variable in one session, so memory usage can be similar to today's workarounds, but against workarounds, session variables use types and access rights. Note - plpgsql doesn't try to delete compiled code from cache immediately too - so the behaviour implemented in 1..4 is "similar" to plpgsql func cache 14 .. allow you to use session variables as arguments of CALL or EXECUTE statement, and variables can be used in plpgsql simple expr. 15 .. variables don't block parallelism 16 .. the result of plpgsql simple expr can be assigned to session variable= s 17 .. expr with session variable can be inlined in SQL 14-17 are performance related 7 - was requested by some people - some functionality can be possibly replaced by plpgsql_check. It has only 40 rows - it just raise warning or error when some conditions are true Regards Pavel > > Yours, > Laurenz Albe > --000000000000ab44fc0620d67dd2 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi

=C3=BAt 27. 8. 2024 v=C2=A016:52 odes=C3=ADla= tel Laurenz Albe <laurenz.al= be@cybertec.at> napsal:
time""On Tue, 2024-08-27 at 08:52 +0200, Pavel Ste= hule wrote:
> I can throw 200KB from another 300KB patch set which can be better for= review, but it
> can be harder to maintain this patch set. I'll try it, and I'l= l send a reduced version.

That was not a criticism, and I think the way you split up the patch set ri= ght now
is as good as it probably gets.=C2=A0 Ideally, one could say something like= "we need at least
patch 1 to 4, 5 and 6 are optional, but desirable, all others can easily be= deferred
to a later time".

It was mentioned= here more times (I thought).

1..4 are fundam= ental
5..6 optional (6 are just tests)

others can be deferred (5-6 can be deferred too). Without support of tem= porary session variables, it=C2=A0 is not too probable to repeatedly CREATE= , DROP the same variable in one session, so memory usage can be similar to = today's workarounds, but against workarounds, session variables use typ= es and access rights. Note - plpgsql doesn't try to delete compiled cod= e from cache immediately too - so the behaviour implemented in 1..4 is &quo= t;similar" to plpgsql func cache

14 .. al= low you to use session variables as arguments of CALL or EXECUTE statement,= and variables can be used in plpgsql simple expr.
15 .. vari= ables don't block parallelism
16 .. the result of plpgsq= l simple expr can be assigned to session variables
17 .. expr wit= h session variable can be inlined in SQL

14-1= 7 are performance related

7 - was requested by= some people - some functionality can be possibly replaced by plpgsql_check= .
It has only 40 rows - it just raise warning or error when = some conditions are true

Regards

Pavel

=C2=A0

Yours,
Laurenz Albe
--000000000000ab44fc0620d67dd2--