missing cache data for cache id 27

From: brian <brian(at)zijn-digital(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: missing cache data for cache id 27
Date: 2007-01-24 16:37:38
Message-ID: 45B78B52.8060307@zijn-digital.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I'm getting the above error when i try to replace a function of mine. It
seems i have two problems: the latest dump (through phpPGAdmin) works
fine, except that a function that should return a record was replaced
without the column definition list, so calls on it are failing.

from pg_dump:
CREATE OR REPLACE FUNCTION getserviceprovidertotalsbytype() RETURNS
SETOF record AS $$

should be:
CREATE OR REPLACE FUNCTION getserviceprovidertotalsbytype(OUT name text,
OUT id INT4, OUT total INT4) RETURNS SETOF record AS $$

So, i tried re-defining the function with the OUT params, and was hit
with the error in the subject line. I was able to DROP it first, then
re-create it. Now everything seems fine. But does anyone know what the
error means?

And why does the function definition in the db dump not reflect that OUT
params are called for?

Here's the entire function, fwiw:

-- snip --
CREATE OR REPLACE FUNCTION getserviceprovidertotalsbytype(OUT name text,
OUT id INT4, OUT total INT4) RETURNS SETOF record AS $$

DECLARE
rec record;

BEGIN
FOR rec IN
EXECUTE 'SELECT id, name, 1 AS total FROM service_type ORDER BY NAME ASC'

LOOP
name := rec.name;
id := rec.id;

SELECT INTO rec.total SUM(CASE sp.accepted WHEN TRUE THEN 1 ELSE 0 END)
FROM service_provider AS sp WHERE sp.id IN
(
SELECT spst.service_provider_id FROM service_provider_service_type AS
spst WHERE spst.service_type_id = rec.id
);

-- If none for this service type, give it a total of zero
IF rec.total IS NULL THEN
SELECT INTO total 0;
ELSE
total := rec.total;
END IF;

RETURN NEXT;
END LOOP;

RETURN;

END;
$$ LANGUAGE plpgsql IMMUTABLE;

-- snip --

brian

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Richard Huxton 2007-01-24 17:07:38 Re: missing cache data for cache id 27
Previous Message org 2007-01-24 16:34:05 Re: STOP all user access except for admin for a few minutes?