Обсуждение: Prepared Statement

Поиск
Список
Период
Сортировка

Prepared Statement

От
"Rosenblum, Jason"
Дата:
Is it possible to create a prepared statement with a parameter that is
actually the column name of a table?

i.e. prepare foo(?) as select $1, count(*) from boo group by $1

Thanks,
Jason

Re: Prepared Statement

От
Tom Lane
Дата:
"Rosenblum, Jason" <jrosenblum@wcmh.org> writes:
> Is it possible to create a prepared statement with a parameter that is
> actually the column name of a table?

No.  In your example, how could the planner do any useful "preparation",
when it doesn't know which column to group by or even what the data type
of the grouping will be?

            regards, tom lane