Re: SRF called with optional NULL input runs 7x slower

Поиск
Список
Период
Сортировка
От Ow Mun Heng
Тема Re: SRF called with optional NULL input runs 7x slower
Дата
Msg-id 1190616829.17050.59.camel@neuromancer.home.net
обсуждение исходный текст
Ответ на Re: SRF called with optional NULL input runs 7x slower  (Alvaro Herrera <alvherre@commandprompt.com>)
Ответы Re: SRF called with optional NULL input runs 7x slower  (Alvaro Herrera <alvherre@commandprompt.com>)
Список pgsql-general
On Mon, 2007-09-24 at 02:31 -0400, Alvaro Herrera wrote:
> Ow Mun Heng wrote:
>
> > Okay.. I tried that, but it seems like there's an issue w/ the CASE
> > statements.
> >
> > When I tried the prepare w/
> >
> > AND (CASE WHEN $3 IS NULL THEN true else d.code = any ($3) END)
> > AND (CASE WHEN $4 IS NULL THEN TRUE else D.id = any($4) END)
> >
> >
> > it ERRORs w/ could not determine data type of parameter $3
>
> Cast it to the correct type.

how do I cast a NULL? Is it Varchar?

Anyway.. I tried

AND (CASE WHEN CAST($3 as VARCHAR) IS NULL THEN true else d.code = any
($3) END)

and I get  ERROR: op ANY/ALL (array) requires array on right side
>

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

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: SRF called with optional NULL input runs 7x slower
Следующее
От: "Anoo Sivadasan Pillai"
Дата:
Сообщение: Why the ERROR: duplicate key violates unique constraint "master_pkey" is raised? - Is this a Bug?