Re: PL/pgSQL 2

From: Craig Ringer <craig(at)2ndquadrant(dot)com>
To: Andres Freund <andres(at)2ndquadrant(dot)com>
Cc: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, Joel Jacobson <joel(at)trustly(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: PL/pgSQL 2
Date: 2014-09-01 14:26:50
Message-ID: 5404822A.7040008@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 09/01/2014 10:24 PM, Andres Freund wrote:
> I know of format(), but it doesn't allow you to pass parameters as
> actual query variables unfortunately.
> I'm wondering if there's a way to marry USING and format()...

Well, the idiom:

EXECUTE format("SELECT %I FROM %I WHERE $1", col, tbl) USING val;

is not lovely. It works, but it's clumsy.

--
Craig Ringer http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Joel Jacobson 2014-09-01 14:29:18 Re: PL/pgSQL 2
Previous Message Andres Freund 2014-09-01 14:24:37 Re: PL/pgSQL 2