Re: PL/pgSQL 2

Поиск
Список
Период
Сортировка
От Craig Ringer
Тема Re: PL/pgSQL 2
Дата
Msg-id 5404822A.7040008@2ndquadrant.com
обсуждение исходный текст
Ответ на Re: PL/pgSQL 2  (Andres Freund <andres@2ndquadrant.com>)
Ответы Re: PL/pgSQL 2  (Pavel Stehule <pavel.stehule@gmail.com>)
Re: PL/pgSQL 2  (Joel Jacobson <joel@trustly.com>)
Список 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



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: PL/pgSQL 2
Следующее
От: Joel Jacobson
Дата:
Сообщение: Re: PL/pgSQL 2