From: Tom Lane <tgl@sss.pgh.pa.us>
To: David G. Johnston <david.g.johnston@gmail.com>
Cc: mbwiese@gmail.com <mbwiese@gmail.com>
Cc: pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>
Subject: Re: BUG #16519: SET SESSION ROLE in plpgsql requires string literal.
Date: Tue, 30 Jun 2020 13:18:57 -0400
Message-ID: <491240.1593537537@sss.pgh.pa.us> (raw)
In-Reply-To: <CAKFQuwZByEvyM9KUtRn0yjT81dGuVaFKpHzBjhVsEAd7WPgasA@mail.gmail.com>
References: <16519-9ef04828d058a319@postgresql.org>
<CAKFQuwZByEvyM9KUtRn0yjT81dGuVaFKpHzBjhVsEAd7WPgasA@mail.gmail.com>
"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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, david.g.johnston@gmail.com, mbwiese@gmail.com, pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #16519: SET SESSION ROLE in plpgsql requires string literal.
In-Reply-To: <491240.1593537537@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox