Re: BUG #12690: EXECUTE statement fails with dynamic column name on record variable - Mailing list pgsql-bugs

From Marko Tiikkaja
Subject Re: BUG #12690: EXECUTE statement fails with dynamic column name on record variable
Date
Msg-id 54C9FBB8.4070502@joh.to
Whole thread Raw
In response to BUG #12690: EXECUTE statement fails with dynamic column name on record variable  (patrick@vanlaake.net)
List pgsql-bugs
On 2015-01-28 11:18, patrick@vanlaake.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

pgsql-bugs by date:

Previous
From: Stephen Frost
Date:
Subject: Re: RLS bug?
Next
From: Michael Paquier
Date:
Subject: Re: BUG #12694: crash if the number of result rows is lower than gin_fuzzy_search_limit