Re: Schema variables - new implementation for Postgres 15 - Mailing list pgsql-hackers

From Pavel Stehule
Subject Re: Schema variables - new implementation for Postgres 15
Date
Msg-id CAFj8pRCPuEJ+vv793vbJ2ZjoXMiVw=G4WGNJCmktjGVpkj4Yrg@mail.gmail.com
Whole thread Raw
In response to Re: Schema variables - new implementation for Postgres 15  (Julien Rouhaud <rjuju123@gmail.com>)
Responses Re: Schema variables - new implementation for Postgres 15
List pgsql-hackers
Hi

ne 23. 1. 2022 v 9:52 odesílatel Julien Rouhaud <rjuju123@gmail.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@gmail.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





pgsql-hackers by date:

Previous
From: Marcos Pegoraro
Date:
Subject: current_schema will not use an text index ?
Next
From: Julien Rouhaud
Date:
Subject: Re: Schema variables - new implementation for Postgres 15