Re: BUG #12690: EXECUTE statement fails with dynamic column name on record variable

From: Marko Tiikkaja <marko(at)joh(dot)to>
To: patrick(at)vanlaake(dot)net, pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #12690: EXECUTE statement fails with dynamic column name on record variable
Date: 2015-01-29 09:22:00
Message-ID: 54C9FBB8.4070502@joh.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On 2015-01-28 11:18, patrick(at)vanlaake(dot)net wrote:
> EXECUTE 'SELECT th.' || quote_ident(period) INTO times;
>
> In this specific context the parser seems to not support or disallow the use
> of a record variable. Is this a bug ?

No. It has nothing to do with the type of the variable; PL/PgSQL
variables are not visible to the query being EXECUTEd at all. See
http://www.postgresql.org/docs/9.4/static/plpgsql-statements.html#PLPGSQL-STATEMENTS-EXECUTING-DYN,
specifically the part:

"No substitution of PL/pgSQL variables is done on the computed command
string. Any required variable values must be inserted in the command
string as it is constructed; or you can use parameters as described below."

.m

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Michael Paquier 2015-01-29 13:09:48 Re: BUG #12694: crash if the number of result rows is lower than gin_fuzzy_search_limit
Previous Message Stephen Frost 2015-01-29 02:57:47 Re: RLS bug?