Re: SPI_prepare, SPI_execute_plan do not return rows when using parameters

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: SPI_prepare, SPI_execute_plan do not return rows when using parameters
Дата
Msg-id 1865.1128541277@sss.pgh.pa.us
обсуждение исходный текст
Ответ на SPI_prepare, SPI_execute_plan do not return rows when using parameters  (Dennis Jenkins <dennis.jenkins@sbcglobal.net>)
Ответы Re: SPI_prepare, SPI_execute_plan do not return rows when using parameters  (Dennis Jenkins <dennis.jenkins@sbcglobal.net>)
Список pgsql-general
Dennis Jenkins <dennis.jenkins@sbcglobal.net> writes:
> My problem is that a query that should be returning a
> row is returning zero rows when I use a parametrized
> query.

You're passing the wrong parameter value, and probably not declaring it
to be the right type either.  CHAROID is not the type you think it is
(BPCHAROID is what you want), and "CStringGetDatum" is not the way to
convert a C string into a char(N) datum.  The most bulletproof way
to do the latter is to use DirectFunctionCall3 to invoke bpcharin().

            regards, tom lane

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Problems with group by ... order by
Следующее
От: "Jim C. Nasby"
Дата:
Сообщение: Re: optimizing common subqueries