Re: [GENERAL] PostgreSQL executing my function too many times during query

2008-05-16 Thread Tom Lane
"D. Dante Lorenso" <[EMAIL PROTECTED]> writes: > Tom Lane wrote: >> I can't reproduce any such problem in 8.2 branch tip, and a desultory >> scan of the CVS history back to 8.2.4 doesn't turn up any obviously >> related patches. Please provide a self-contained test case for what >> you're seeing.

Re: [GENERAL] PostgreSQL executing my function too many times during query

2008-05-16 Thread D. Dante Lorenso
Tom Lane wrote: "D. Dante Lorenso" <[EMAIL PROTECTED]> writes: So, that not being the problem, any ideas? Is it an 8.2.4 thing? I can't reproduce any such problem in 8.2 branch tip, and a desultory scan of the CVS history back to 8.2.4 doesn't turn up any obviously related patches. Please pr

Re: [GENERAL] PostgreSQL executing my function too many times during query

2008-05-15 Thread Tom Lane
"D. Dante Lorenso" <[EMAIL PROTECTED]> writes: > So, that not being the problem, any ideas? Is it an 8.2.4 thing? I can't reproduce any such problem in 8.2 branch tip, and a desultory scan of the CVS history back to 8.2.4 doesn't turn up any obviously related patches. Please provide a self-conta

Re: [GENERAL] PostgreSQL executing my function too many times during query

2008-05-15 Thread D. Dante Lorenso
Tom Lane wrote: "D. Dante Lorenso" <[EMAIL PROTECTED]> writes: This format causes the function to execute too many times: SELECT COUNT(*) AS result FROM credit_card WHERE card_number_enc = cc_encrypt('4111---', 'pwd') AND card_number_enc != cc_encrypt('4111

Re: [GENERAL] PostgreSQL executing my function too many times during query

2008-05-15 Thread Tom Lane
"D. Dante Lorenso" <[EMAIL PROTECTED]> writes: > This format causes the function to execute too many times: >SELECT COUNT(*) AS result >FROM credit_card >WHERE card_number_enc = cc_encrypt('4111---', 'pwd') >AND card_number_enc != cc_encrypt('4111', 'pwd');

[GENERAL] PostgreSQL executing my function too many times during query

2008-05-15 Thread D. Dante Lorenso
I have several records in my database which have encrypted fields. I want to find all the ones that match a certain format but do NOT match another. My problem is that the 'cc_encrypt' function is being executed for every matching row in the table instead of just once. The function was defi