Re: Schema variables - new implementation for Postgres 15

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Dmitry Dolgov <9erthalion6(at)gmail(dot)com>
Cc: Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>, Sergey Shinderuk <s(dot)shinderuk(at)postgrespro(dot)ru>, Tomas Vondra <tomas(dot)vondra(at)enterprisedb(dot)com>, Julien Rouhaud <rjuju123(at)gmail(dot)com>, dean(dot)a(dot)rasheed(at)gmail(dot)com, er(at)xs4all(dot)nl, joel(at)compiler(dot)org, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Schema variables - new implementation for Postgres 15
Date: 2023-11-18 17:28:53
Message-ID: CAFj8pRB9hqejftV4gdW2ovV7h_uM=e3rWZyq4TARi1FxefcTPw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

so 18. 11. 2023 v 15:54 odesílatel Dmitry Dolgov <9erthalion6(at)gmail(dot)com>
napsal:

> > On Sat, Nov 18, 2023 at 02:19:09PM +0100, Pavel Stehule wrote:
> > > Would it be a problem to make pg_session_variables inspect the catalog
> > > or something similar if needed?
> > >
> >
> > It can be very easy to build pg_session_variables based on iteration over
> > the system catalog. But I am not sure if we want it.
> pg_session_variables()
> > is designed to show the variables from session memory, and it is used for
> > testing. Originally it was named pg_debug_session_variables. If we
> iterate
> > over catalog, it means using locks, and it can have an impact on
> isolation
> > tests.
>
> I see, thanks for clarification. In the end one can check the catalog
> directly of course, is there any other value in this function except for
> debugging purposes?
>

I have no idea how it can be used for different purposes. Theoretically it
can be used to check if some variable was used (initialized) in a session
already. But for this purpose it is not too practical, and if there will be
some request for this functionality, then we can write a special function
for this purpose. But I don't know any actual use cases for this.

> As a side note, I'm intended to go one more time through the first few
> patches introducing the basic functionality, and then mark it as ready
> in CF. I can't break the patch in testing since quite long time, and for
> most parts the changes make sense to me.
>

Thank you very much, for testing, comments, and all other work.

I marked pg_session_variables function as PARALLEL RESTRICTED, and did
rebase

Regards

Pavel

Attachment Content-Type Size
v20231118-0009-this-patch-changes-error-message-column-doesn-t-exis.patch text/x-patch 29.1 KB
v20231118-0008-Implementation-of-NOT-NULL-and-IMMUTABLE-clauses.patch text/x-patch 35.7 KB
v20231118-0006-Implementation-ON-TRANSACTION-END-RESET-clause.patch text/x-patch 14.4 KB
v20231118-0007-Implementation-of-DEFAULT-clause-default-expressions.patch text/x-patch 30.6 KB
v20231118-0005-implementation-of-temporary-session-variables.patch text/x-patch 37.2 KB
v20231118-0003-DISCARD-VARIABLES.patch text/x-patch 9.2 KB
v20231118-0004-memory-cleaning-after-DROP-VARIABLE.patch text/x-patch 22.3 KB
v20231118-0002-Storage-for-session-variables-and-SQL-interface.patch text/x-patch 205.9 KB
v20231118-0001-Enhancing-catalog-for-support-session-variables-and-.patch text/x-patch 137.8 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2023-11-18 18:01:42 Re: Use of backup_label not noted in log
Previous Message Joseph Koshakow 2023-11-18 16:53:47 Re: Infinite Interval