pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Marko Tiikkaja <marko@joh.to>
To: patrick@vanlaake.net
To: pgsql-bugs@postgresql.org
Subject: Re: BUG #12690: EXECUTE statement fails with dynamic column name on record variable
Date: Thu, 29 Jan 2015 10:22:00 +0100
Message-ID: <54C9FBB8.4070502@joh.to> (raw)
In-Reply-To: <20150128101839.2585.73885@wrigleys.postgresql.org>
References: <20150128101839.2585.73885@wrigleys.postgresql.org>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-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


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



view thread (2+ messages)

Message-ID: <54C9FBB8.4070502@joh.to>
Permalink:  ../54C9FBB8.4070502@joh.to/
Also on:    postgresql.org/message-id/54C9FBB8.4070502@joh.to

 · 

reply

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: marko@joh.to, patrick@vanlaake.net
  Subject: Re: BUG #12690: EXECUTE statement fails with dynamic column name on record variable
  In-Reply-To: <54C9FBB8.4070502@joh.to>
  References: <20150128101839.2585.73885@wrigleys.postgresql.org> <54C9FBB8.4070502@joh.to>

* 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