Re: Help! Error when calling a function

From: "Mendola Gaetano" <mendola(at)bigfoot(dot)com>
To: <bschneider(at)microdynamics(dot)cc>, "Postgres Admin List" <pgsql-admin(at)postgresql(dot)org>
Subject: Re: Help! Error when calling a function
Date: 2003-06-07 18:02:41
Message-ID: 004201c32d1e$fe027ab0$10d4a8c0@mm.eutelsat.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

"Ben Schneider" <bschneider(at)microdynamics(dot)cc> wrote:

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

> Warning: pg_exec() [function.pg-exec <http://www.php.net/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

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Björn Metzdorf 2003-06-07 21:56:49 Uninitialized page - fixing
Previous Message Joe Conway 2003-06-07 16:17:12 Re: Help! Error when calling a function