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

From Wolfgang Walther
Subject Re: Schema variables - new implementation for Postgres 15
Date
Msg-id 289fd81b-8c11-490b-9d4c-6aa23233db7b@technowledgy.de
Whole thread Raw
In response to Re: Schema variables - new implementation for Postgres 15  (Pavel Stehule <pavel.stehule@gmail.com>)
Responses Re: Schema variables - new implementation for Postgres 15
List pgsql-hackers
Pavel Stehule:
> 2. But my main argument is, it is not really safe - it solves Peter's 
> use case, but if I use a reverse example of Peter's case, I still have a 
> problem.
> 
> I can have a variable x, and then I can write query like `SELECT x FROM x`;
> 
> but if somebody creates table x(x int), then the query `SELECT x FROM x` 
> will be correct, but it is surely something else. So the requirement of 
> the usage variable inside FROM clause doesn't help. It doesn't work.

But in this case you could make variables and tables share the same 
namespace, i.e. forbid creating a variable with the same name as an 
already existing table.

Best,

Wolfgang



pgsql-hackers by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: Schema variables - new implementation for Postgres 15
Next
From: Pavel Stehule
Date:
Subject: Re: Schema variables - new implementation for Postgres 15