Re: BUG #16519: SET SESSION ROLE in plpgsql requires string literal.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: "mbwiese(at)gmail(dot)com" <mbwiese(at)gmail(dot)com>, "pgsql-bugs(at)lists(dot)postgresql(dot)org" <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: BUG #16519: SET SESSION ROLE in plpgsql requires string literal.
Date: 2020-06-30 17:18:57
Message-ID: 491240.1593537537@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

"David G. Johnston" <david(dot)g(dot)johnston(at)gmail(dot)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

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Michael Meskes 2020-06-30 17:18:58 Re: [BUG][PATCH] ecpg crash with bytea type and cursors
Previous Message Jehan-Guillaume de Rorthais 2020-06-30 16:57:16 Re: [BUG][PATCH] ecpg crash with bytea type and cursors