| From: | Rolf Schaufelberger <rs(at)plusw(dot)de> | 
|---|---|
| To: | Undisclosed(dot)Recipients: ; | 
| Cc: | pgsql-de-allgemein(at)postgresql(dot)org | 
| Subject: | Re: cache lookup failed for function ... | 
| Date: | 2007-08-30 11:37:09 | 
| Message-ID: | 200708301337.09100.rs@plusw.de | 
| Views: | Whole Thread | Raw Message | Download mbox | Resend email | 
| Thread: | |
| Lists: | pgsql-de-allgemein | 
On Donnerstag 30 August 2007, Peter Eisentraut wrote:
> Am Donnerstag, 30. August 2007 12:00 schrieb Rolf Schaufelberger:
> > Meine Grundsätzliche Frage: Wo ist dieses verhalten (caching von
> > Funktionen) dokumentiert und kann man das beeinflussen ? Wann / Wie wird
> > der cache gelöscht ?
>
> Es gibt keine Cache für Funktionen. Da müsste man schon man ein konkreteres
> Beispiel sehen, um zu erkennen, warum es nicht funktioniert.
anbei mal die DEBUG Ausgabe. Sie auch vorherigen antwort an a.Kretschmar.
====================
	select calculate_preis(832);
NOTICE:  Custid = 20002, Currencyid = 1 , Country= DE, Discount = 0
KONTEXT:  SQL statement "SELECT  calculate_preis(  $1 ,  $2 )"
PL/pgSQL function "calculate_preis" line 7 at perform
NOTICE:  Search price for item 2735 article 58
KONTEXT:  SQL statement "SELECT  calculate_preis(  $1 ,  $2 )"
PL/pgSQL function "calculate_preis" line 7 at perform
NOTICE:  No article_price_id
KONTEXT:  PL/pgSQL function "calculate_preis" line 68 at assignment
SQL statement "SELECT  calculate_preis(  $1 ,  $2 )"
PL/pgSQL function "calculate_preis" line 7 at perform
NOTICE:  Search price for item 2736 article 59
KONTEXT:  SQL statement "SELECT  calculate_preis(  $1 ,  $2 )"
PL/pgSQL function "calculate_preis" line 7 at perform
NOTICE:  Search company price
KONTEXT:  PL/pgSQL function "calculate_preis" line 68 at assignment
SQL statement "SELECT  calculate_preis(  $1 ,  $2 )"
PL/pgSQL function "calculate_preis" line 7 at perform
NOTICE:  Search licence price
KONTEXT:  PL/pgSQL function "calculate_preis" line 68 at assignment
SQL statement "SELECT  calculate_preis(  $1 ,  $2 )"
PL/pgSQL function "calculate_preis" line 7 at perform
NOTICE:  Search common price
KONTEXT:  PL/pgSQL function "calculate_preis" line 68 at assignment
SQL statement "SELECT  calculate_preis(  $1 ,  $2 )"
PL/pgSQL function "calculate_preis" line 7 at perform
NOTICE:  Updating 2736 to price 995
KONTEXT:  SQL statement "SELECT  calculate_preis(  $1 ,  $2 )"
PL/pgSQL function "calculate_preis" line 7 at perform
NOTICE:  Search price for item 2737 article 42
KONTEXT:  SQL statement "SELECT  calculate_preis(  $1 ,  $2 )"
PL/pgSQL function "calculate_preis" line 7 at perform
NOTICE:  Updating 2737 to price -99
KONTEXT:  SQL statement "SELECT  calculate_preis(  $1 ,  $2 )"
PL/pgSQL function "calculate_preis" line 7 at perform
SQL statement "SELECT  calculate_preis(  $1 ,  $2 )"
PL/pgSQL function "calculate_preis" line 7 at perform
NOTICE:  Add_bonus: Found item 101, value=10 type=PERC_ALL <====
KONTEXT:  SQL statement "SELECT  add_bonus( $1 )"
PL/pgSQL function "calculate_preis" line 106 at perform
SQL statement "SELECT  calculate_preis(  $1 ,  $2 )"
PL/pgSQL function "calculate_preis" line 7 at perform
NOTICE:  gesamtpreis = 0                                                 <====
KONTEXT:  SQL statement "SELECT  add_bonus( $1 )"
PL/pgSQL function "calculate_preis" line 106 at perform
SQL statement "SELECT  calculate_preis(  $1 ,  $2 )"
PL/pgSQL function "calculate_preis" line 7 at perform
NOTICE:  add_bonus: set preis to 0                                <====
KONTEXT:  SQL statement "SELECT  add_bonus( $1 )"
PL/pgSQL function "calculate_preis" line 106 at perform
SQL statement "SELECT  calculate_preis(  $1 ,  $2 )"
PL/pgSQL function "calculate_preis" line 7 at perform
NOTICE:  Updating pay_order to 1525
KONTEXT:  SQL statement "SELECT  calculate_preis(  $1 ,  $2 )"
PL/pgSQL function "calculate_preis" line 7 at perform
NOTICE:  Updating bilder_item 2735 to 995
KONTEXT:  SQL statement "SELECT  calculate_preis(  $1 ,  $2 )"
PL/pgSQL function "calculate_preis" line 7 at perform
 calculate_preis
-----------------
(1 Zeile)
pgp=#
========================
Man beachte die  Zeilen die ich mit <==== markiert habe. 
Es geht um die Funktion add_bonus.
und dann:
========================
pgp=# select add_bonus(832);
NOTICE:  Add_bonus: Found item 101, value=10 type=PERC_ALL
NOTICE:  gesamtpreis = 995
NOTICE:  add_bonus: set preis to 99
 add_bonus
-----------
(1 Zeile)
pgp=#                 
========================
bzw :
pgp=# select gesamtpreis(832);
 gesamtpreis
-------------
         995
(1 Zeile)
pgp=#  
==============
calculate_preis ruft add_bonus und diese gesamtpreis 
-- 
Rolf Schaufelberger
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Rolf Schaufelberger | 2007-08-30 11:38:38 | Re: cache lookup failed for function ... | 
| Previous Message | A. Kretschmer | 2007-08-30 11:30:30 | Re: cache lookup failed for function ... |