[EMAIL PROTECTED] wrote:
Tom Lane wrote:
you're still gonna lose because those are variables not constants ...

Well, that *is* what I'm hoping to do. I understand how (0 IS NULL) is different from (variable IS NULL), but isn't it reasonable to expect that PG could evaluate that expression only once (knowing that the variable couldn't change during the course of the query execution) and then treat that expression as constant?

Also, I should mention that in my case, the "variables" are actually constants either defined in the function param list (and thus non-modifiable within the function body) or defined with:

  DECLARE vC1 CONSTANT varchar(10) := 'blah'

-type syntax. I would submit that in that situation, it would be reasonable for a user to expect my suggested syntax to still use the indicated indexes.

Do you agree? It it possible that something other than picking up the 'IS NULL' boolean as constant has changed between 8.0.x & 8.2 that might make this work?

Thanks,

jl

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

              http://archives.postgresql.org/

Reply via email to