Re: BUG #16519: SET SESSION ROLE in plpgsql requires string literal. - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #16519: SET SESSION ROLE in plpgsql requires string literal.
Date
Msg-id 491240.1593537537@sss.pgh.pa.us
Whole thread Raw
In response to Re: BUG #16519: SET SESSION ROLE in plpgsql requires string literal.  ("David G. Johnston" <david.g.johnston@gmail.com>)
Responses Re: BUG #16519: SET SESSION ROLE in plpgsql requires string literal.
List pgsql-bugs
"David G. Johnston" <david.g.johnston@gmail.com> writes:
> 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.

While this is documented (last para of "42.11.1. Variable Substitution"),
it's not exactly prominent.  Should we move that to somewhere more
visible?  If so where?

            regards, tom lane



pgsql-bugs by date:

Previous
From: Jehan-Guillaume de Rorthais
Date:
Subject: Re: [BUG][PATCH] ecpg crash with bytea type and cursors
Next
From: Michael Meskes
Date:
Subject: Re: [BUG][PATCH] ecpg crash with bytea type and cursors