Re: Schema variables - new implementation for Postgres 15

Поиск
Список
Период
Сортировка
От Pavel Stehule
Тема Re: Schema variables - new implementation for Postgres 15
Дата
Msg-id CAFj8pRC_EcwAA23F8shpiAggR=5=8ci2qhYa79Fa-6by-TqD6A@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Schema variables - new implementation for Postgres 15  (Wolfgang Walther <walther@technowledgy.de>)
Ответы Re: Schema variables - new implementation for Postgres 15
Список pgsql-hackers


pá 31. 5. 2024 v 13:10 odesílatel Wolfgang Walther <walther@technowledgy.de> napsal:
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.

It helps, but not on 100% - there is a search path

 

Best,

Wolfgang

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Wolfgang Walther
Дата:
Сообщение: Re: Schema variables - new implementation for Postgres 15
Следующее
От: Wolfgang Walther
Дата:
Сообщение: Re: Schema variables - new implementation for Postgres 15