Re: Help! Error when calling a function - Mailing list pgsql-admin

From Joe Conway
Subject Re: Help! Error when calling a function
Date
Msg-id 3EE21008.2060201@joeconway.com
Whole thread Raw
In response to Help! Error when calling a function  ("Ben Schneider" <bschneider@microdynamics.cc>)
List pgsql-admin
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


pgsql-admin by date:

Previous
From: "Mendola Gaetano"
Date:
Subject: Re: Help! Error when calling a function
Next
From: Rafael Mauricio González Palacios
Date:
Subject: What could be the problem?