| From: | Alvaro Herrera <alvherre(at)commandprompt(dot)com> |
|---|---|
| To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
| Cc: | Stefan Kaltenbrunner <stefan(at)kaltenbrunner(dot)cc>, Stefan Huehner <stefan(at)huehner(dot)org>, pgsql-bugs(at)postgresql(dot)org |
| Subject: | Re: Bug (8.4beta): FailedAssertion("!(bms_is_subset(relids, qualscope))", File: "initsplan.c", Line: 915) |
| Date: | 2009-05-06 17:38:51 |
| Message-ID: | 20090506173851.GG4476@alvh.no-ip.org |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-bugs |
Tom Lane wrote:
> Oh! What is happening is that to_number(1) is being reduced to constant
> NULL, whereupon it concludes that ad_tab_id=to_number(1) is constant
> NULL, ergo the EXISTS can never succeed, ergo the entire WHERE is
> constant false.
> CREATE FUNCTION to_number(integer) RETURNS numeric
> LANGUAGE plpgsql IMMUTABLE
> AS $_$
> BEGIN
> RETURN to_number($1, 'S99999999999999D999999');
> EXCEPTION
> WHEN OTHERS THEN
> RETURN NULL;
> END;
> $_$;
How can the executor "see through" a plpgsql function definition? Or do
you mean that this reduction is being done at execution time? (hmm ...
this is what a one-time filter is, now that I think about it?)
--
Alvaro Herrera http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Heikki Linnakangas | 2009-05-06 17:45:05 | Re: Bug (8.4beta): FailedAssertion("!(bms_is_subset(relids, qualscope))", File: "initsplan.c", Line: 915) |
| Previous Message | Stefan Huehner | 2009-05-06 17:36:44 | Re: Bug (8.4beta): FailedAssertion("!(bms_is_subset(relids, qualscope))", File: "initsplan.c", Line: 915) |