From bschneider@microdynamics.cc Fri Jun 6 20:11:30 2003 X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (developer.postgresql.org [64.117.224.193]) by svr1.postgresql.org (Postfix) with ESMTP id ED4CBEFF9C for ; Fri, 6 Jun 2003 20:11:30 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (svr1.postgresql.org [64.117.224.193]) (amavisd-new, port 10024) with ESMTP id 82611-07 for ; Fri, 6 Jun 2003 20:11:29 +0000 (GMT) Received: from trece.agalis.net (trece.agalis.net [207.173.203.233]) by svr1.postgresql.org (Postfix) with SMTP id A583BEFF9B for ; Fri, 6 Jun 2003 20:11:26 +0000 (GMT) Received: (qmail 12008 invoked by uid 506); 6 Jun 2003 20:16:15 -0000 Received: from bschneider@microdynamics.cc by trece by uid 503 with qmail-scanner-1.15 (uvscan: v4.1.60/v4252. Clear:. Processed in 0.804552 secs); 06 Jun 2003 20:16:15 -0000 Received: from unknown (HELO micronpc) (207.189.110.29) by trece.agalis.net with SMTP; 6 Jun 2003 20:16:14 -0000 Reply-To: From: "Ben Schneider" To: "Postgres Admin List" Subject: Help! Error when calling a function Date: Fri, 6 Jun 2003 13:12:50 -0700 Message-ID: <000001c32c68$05a00560$5011a8c0@micronpc> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0001_01C32C2D.5942B400" X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.4510 Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Spam-Status: No, hits=0.6 tagged_above=0.0 required=5.0 tests=HTML_50_60, HTML_MESSAGE X-Spam-Level: * X-Archive-Number: 200306/41 X-Sequence-Number: 9032 This is a multi-part message in MIME format. ------=_NextPart_000_0001_01C32C2D.5942B400 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable I am receiving the following error when I call a simple function: =20 Warning: pg_exec() [function.pg-exec ]: Query failed: ERROR: fmgr_info: function 3036754: cache lookup failed . in /var/www/html/cmwareben/db_pgsql.php on line 93 Database error: Invalid SQL: SELECT note_num, fn_concat(rtrim(substring(note,0,40)), '...') AS note FROM feedback_notes ORDER BY note_num PostgreSQL Error: 1 (ERROR: fmgr_info: function 3036754: cache lookup failed ) Session halted. =20 Here is the fn_concat function that I am calling =20 CREATE FUNCTION "fn_concat"(text, text) RETURNS text AS 'begin return $1 || $2; end;' LANGUAGE 'plpgsql' =20 I have the same function in another DB on the same server and it is working fine. The only change I made to the DB was to drop the feedback_notes table and recreate it with an additional column (New column =3D 'status'). The select was working before I made this change and now it doesn't. No changes were made to my PHP scripts at all! I hadn't don't even call the new column in my select. =20 What the heck happened? =20 Ben ------=_NextPart_000_0001_01C32C2D.5942B400 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

I am receiving the following error when I call a simple function:

 

Warning: pg_e= xec() [function.pg-exec]: Que= ry failed: ERROR: fmgr_info: function 3036754: cache lookup failed . in /var/www/html/cmwareben/db_pgsql.php = on line 93
Database error: Invalid SQL: SELECT note_num, fn_concat(rtrim(substring(note,0,40)), '...') AS note FROM= feedback_notes ORDER BY note_num
PostgreSQL Error: 1 (ERROR: = fmgr_info: function 3036754: cache lookup failed )
Session halted.

 

Here is the fn_concat function that I am calling

 

CREATE FUNCTION "fn_concat"(text, text) RETURN= S text AS 'begin
return $1 || $2;
end;' LANGUAGE 'plpgsql'

 

I have the same function in another DB on the same server and it is working fine. The only change I made to the DB was to drop the fe= edback_notes table and recreate it with an additional column (New column =3D ‘stat= us’). The select was working before I made this change and now it doesn’t. = No changes were made to my PHP scripts at all! I hadn’t don’t even call the new column in my select.

 

What the heck happened?

 

Ben

------=_NextPart_000_0001_01C32C2D.5942B400-- From mail@joeconway.com Sat Jun 7 16:18:23 2003 X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (developer.postgresql.org [64.117.224.193]) by svr1.postgresql.org (Postfix) with ESMTP id B21DBF0091 for ; Sat, 7 Jun 2003 16:18:23 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (svr1.postgresql.org [64.117.224.193]) (amavisd-new, port 10024) with ESMTP id 33487-09 for ; Sat, 7 Jun 2003 16:18:13 +0000 (GMT) Received: from joeconway.com (66-146-172-86.skyriver.net [66.146.172.86]) by svr1.postgresql.org (Postfix) with ESMTP id DE29EF0085 for ; Sat, 7 Jun 2003 16:18:12 +0000 (GMT) Received: from [192.168.5.3] (account jconway HELO joeconway.com) by joeconway.com (CommuniGate Pro SMTP 4.0.6) with ESMTP-TLS id 1790104; Sat, 07 Jun 2003 08:54:23 -0700 Message-ID: <3EE21008.2060201@joeconway.com> Date: Sat, 07 Jun 2003 09:17:12 -0700 From: Joe Conway User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.3) Gecko/20030312 X-Accept-Language: en-us, en MIME-Version: 1.0 To: bschneider@microdynamics.cc Cc: Postgres Admin List Subject: Re: Help! Error when calling a function References: <000001c32c68$05a00560$5011a8c0@micronpc> In-Reply-To: <000001c32c68$05a00560$5011a8c0@micronpc> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Archive-Number: 200306/78 X-Sequence-Number: 9069 Ben Schneider wrote: > fine. The only change I made to the DB was to drop the feedback_notes table > and recreate it with an additional column (New column = 'status'). The > select was working before I made this change and now it doesn't. I can't explain the exact cause in this case, because I don't see right off how it fits, but cache lookup failure is typically caused by dropping and recreating some object that is referenced somewhere else. Are there views referencing that table somewhere in this? BTW, you could have done ALTER TABLE ADD COLUMN. In any case, this might fix it: CREATE OR REPLACE FUNCTION "fn_concat"(text, text) RETURNS text AS 'begin return $1 || $2; end;' LANGUAGE 'plpgsql'; But I'm not sure why you'd want to use plpgsql for that; I'd use: DROP FUNCTION "fn_concat"(text, text); CREATE OR REPLACE FUNCTION "fn_concat"(text, text) RETURNS text AS 'SELECT $1 || $2' LANGUAGE 'sql'; HTH, Joe From mendola@bigfoot.com Sat Jun 7 18:05:40 2003 X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (developer.postgresql.org [64.117.224.193]) by svr1.postgresql.org (Postfix) with ESMTP id 1370FF006C for ; Sat, 7 Jun 2003 18:05:40 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (svr1.postgresql.org [64.117.224.193]) (amavisd-new, port 10024) with ESMTP id 49617-02 for ; Sat, 7 Jun 2003 18:05:29 +0000 (GMT) Received: from smtp.noos.fr (nan-smtp-05.noos.net [212.198.2.74]) by svr1.postgresql.org (Postfix) with ESMTP id 4E808F001F for ; Sat, 7 Jun 2003 18:02:47 +0000 (GMT) Received: (qmail 3908012 invoked by uid 0); 7 Jun 2003 18:02:46 -0000 Received: from unknown (HELO gmendola) ([212.198.40.246]) (envelope-sender ) by 212.198.2.74 (qmail-ldap-1.03) with SMTP for ; 7 Jun 2003 18:02:46 -0000 Message-ID: <004201c32d1e$fe027ab0$10d4a8c0@mm.eutelsat.org> From: "Mendola Gaetano" To: , "Postgres Admin List" References: <000001c32c68$05a00560$5011a8c0@micronpc> Subject: Re: Help! Error when calling a function Date: Sat, 7 Jun 2003 20:02:41 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Archive-Number: 200306/77 X-Sequence-Number: 9068 "Ben Schneider" wrote: > I am receiving the following error when I call a simple function: > Warning: pg_exec() [function.pg-exec > ]: Query failed: ERROR: fmgr_info: function 3036754: cache lookup failed . > in /var/www/html/cmwareben/db_pgsql.php on line 93 > Database error: Invalid SQL: SELECT note_num, > fn_concat(rtrim(substring(note,0,40)), '...') AS note FROM feedback_notes > ORDER BY note_num > PostgreSQL Error: 1 (ERROR: fmgr_info: function 3036754: cache lookup failed ) > Session halted. > Here is the fn_concat function that I am calling > CREATE FUNCTION "fn_concat"(text, text) RETURNS text AS 'begin > return $1 || $2; > end;' LANGUAGE 'plpgsql' >I have the same function in another DB on the same server and it is working > fine. The only change I made to the DB was to drop the feedback_notes table > and recreate it with an additional column (New column = 'status'). The > select was working before I made this change and now it doesn't. No changes > were made to my PHP scripts at all! I hadn't don't even call the new column > in my select. > What the heck happened? Hi, I guess that you are using a prior the 7.3.X, this error happen each time that a DB object ( view table function ) use another DB object and the object used was deleted and recreated. Using the version 7.3.X you can specify for the view or eather for function the RECREATE ability ( the internal object ID does not change ). Upgrading to version 7.3. X ( I suggest you the 7.3.3 ) you avoid the deletetion of an object if other object are depending on it and also you can specify the "REPLACE" when you modify a view or a function. Regards Gaetano Mendola