Re: SRF called with optional NULL input runs 7x slower - Mailing list pgsql-general

From Alvaro Herrera
Subject Re: SRF called with optional NULL input runs 7x slower
Date
Msg-id 20070924063148.GH5661@alvh.no-ip.org
Whole thread Raw
In response to Re: SRF called with optional NULL input runs 7x slower  (Ow Mun Heng <Ow.Mun.Heng@wdc.com>)
Responses Re: SRF called with optional NULL input runs 7x slower  (Ow Mun Heng <Ow.Mun.Heng@wdc.com>)
List pgsql-general
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.

--
Alvaro Herrera       Valdivia, Chile   ICBM: S 39º 49' 18.1", W 73º 13' 56.4"
"Cómo ponemos nuestros dedos en la arcilla del otro. Eso es la amistad; jugar
al alfarero y ver qué formas se pueden sacar del otro" (C. Halloway en
La Feria de las Tinieblas, R. Bradbury)

pgsql-general by date:

Previous
From: Ow Mun Heng
Date:
Subject: Re: SRF called with optional NULL input runs 7x slower
Next
From: Ow Mun Heng
Date:
Subject: Re: SRF called with optional NULL input runs 7x slower