Re: BUG #16519: SET SESSION ROLE in plpgsql requires string literal.
От | David G. Johnston |
---|---|
Тема | Re: BUG #16519: SET SESSION ROLE in plpgsql requires string literal. |
Дата | |
Msg-id | CAKFQuwZByEvyM9KUtRn0yjT81dGuVaFKpHzBjhVsEAd7WPgasA@mail.gmail.com обсуждение исходный текст |
Ответ на | BUG #16519: SET SESSION ROLE in plpgsql requires string literal. (PG Bug reporting form <noreply@postgresql.org>) |
Ответы |
Re: BUG #16519: SET SESSION ROLE in plpgsql requires string literal.
|
Список | pgsql-bugs |
On Tuesday, June 30, 2020, PG Bug reporting form <noreply@postgresql.org> wrote:
The following bug has been logged on the website:
Bug reference: 16519
Logged by: Marianne B. Wiese
Email address: mbwiese@gmail.com
PostgreSQL version: 10.12
Operating system: Ubuntu 18.04
Description:
However, the loop in below function gives me an error:
[22023] ERROR: role "inuser" does not exist Where: SQL statement "SET
SESSION ROLE TO InUser" PL/pgSQL function change_user(name) line 8 at SQL
statement.
SET SESSION ROLE TO InUser;
The SET command cannot be parameterized so using variables in the statement is not supported and the attempt to do so is treated as writing an identifier. You will need to use the format function and the execute plpgsql command to create and execute the statement.
David J.
В списке pgsql-bugs по дате отправления: