Re: Schema variables - new implementation for Postgres 15

Поиск
Список
Период
Сортировка
От Wolfgang Walther
Тема Re: Schema variables - new implementation for Postgres 15
Дата
Msg-id 21674615-582e-42d0-b9a8-4dadbc8b7dad@technowledgy.de
обсуждение исходный текст
Ответ на Re: Schema variables - new implementation for Postgres 15  (Pavel Stehule <pavel.stehule@gmail.com>)
Ответы Re: Schema variables - new implementation for Postgres 15
Список pgsql-hackers
Pavel Stehule:
> The session variables can be used in queries, but should be used in 
> PL/pgSQL expressions, and then the mandatory usage in FROM clause will 
> do lot of problems and unreadable code like
> 
> DO $$
> BEGIN
>    RAISE NOTICE '% %', (SELECT x FROM x), (SELECT a,b FROM y);
> 
> END
> $$
> 
> This requirement does variables unusable in PL

I already proposed earlier to only require listing them in FROM when 
there is actually a related FROM.

In this case you could still write:

RAISE NOTICE '% %', x, (SELECT a,b FROM y);

(assuming only x is a variable here)

Best,

Wolfgang



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

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