Re: Schema variables - new implementation for Postgres 15

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Julien Rouhaud <rjuju123(at)gmail(dot)com>
Cc: Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com>, Joel Jacobson <joel(at)compiler(dot)org>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Schema variables - new implementation for Postgres 15
Date: 2022-01-23 14:33:33
Message-ID: CAFj8pRCPuEJ+vv793vbJ2ZjoXMiVw=G4WGNJCmktjGVpkj4Yrg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi

ne 23. 1. 2022 v 9:52 odesílatel Julien Rouhaud <rjuju123(at)gmail(dot)com> napsal:

> Hi,
>
> On Sun, Jan 23, 2022 at 09:25:56AM +0100, Pavel Stehule wrote:
> > ne 23. 1. 2022 v 9:10 odesílatel Julien Rouhaud <rjuju123(at)gmail(dot)com>
> napsal:
> >
> > Isn't there enough stability of the system cache? sinval is sent at the
> > moment when changes in the system catalog are visible. So inside query
> > execution I don't see that the variable was dropped in another session.
>
> Yes, inside a single query it should probably be ok, but I'm talking about
> multiple query execution in the same transaction.
>

I tested it now. a sinval message is waiting on the transaction end. So
when a variable is used, then it is working fine until the transaction ends.
But when the session makes some DDL, then send sinval to self, and at this
moment, the variable can be dropped before the transaction ends.

So to be safe, the lock is required. I'll do it tomorrow.

Regards

Pavel

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Julien Rouhaud 2022-01-23 15:06:15 Re: Schema variables - new implementation for Postgres 15
Previous Message Marcos Pegoraro 2022-01-23 14:00:12 current_schema will not use an text index ?