Received: from epsilon.clg.qc.ca (root@epsilon.clg.qc.ca [204.19.10.34]) by hub.org (8.9.3/8.9.3) with ESMTP id RAA96220 for ; Mon, 8 Nov 1999 17:44:34 -0500 (EST) (envelope-from prevoste@saturne.clg.qc.ca) Received: from saturne.clg.qc.ca (saturne.clg.qc.ca [205.237.246.35]) by epsilon.clg.qc.ca (8.8.3/8.8.3) with SMTP id TAA18497 for ; Mon, 8 Nov 1999 19:11:27 -0500 Received: from SATURNE/TEMPQ by saturne.clg.qc.ca (Mercury 1.13); Mon, 8 Nov 99 17:44:36 -0500 Received: from TEMPQ by SATURNE (Mercury 1.13); Mon, 8 Nov 99 17:44:17 -0500 Received: from eric.clg.qc.ca by saturne.clg.qc.ca (Mercury 1.13); Mon, 8 Nov 99 17:44:16 -0500 From: Eric Prevost-Dansereau To: pgsql-sql@postgresql.org Subject: Problem with a PL/pgSQL function Date: Mon, 8 Nov 1999 17:38:50 -0500 X-Mailer: KMail [version 1.0.28] Content-Type: text/plain MIME-Version: 1.0 Message-Id: <99110817441400.02118@eric.clg.qc.ca> Content-Transfer-Encoding: 8bit I create that function: CREATE FUNCTION livreEmprunte(int8) RETURNS varchar AS ' DECLARE reponse varchar(200); noDocu alias for $1; BEGIN SELECT CASE WHEN dateremise > date(now()) then varchar \'Emprunté jusqu\'\'au \'|| substring(datetime_text(now()) from 21 for 4)|| varchar \'-\'||substring(datetime_text(now()) from 5 for 3)|| varchar \'-\'||substring(datetime_text(now()) from 9 for 2)|| varchar \' par \'||nomembre WHEN dateremise < date(now()) then nomembre|| varchar \' devait le remettre le \'|| substring(datetime_text(now()) from 21 for 4)|| varchar \'-\'|| substring(datetime_text(now()) from 5 for 3)|| varchar \'-\'|| substring(datetime_text(now()) from 9 for 2) ELSE varchar \'Disponible\' END AS disponibilite INTO reponse FROM prets WHERE montantpaye IS NULL AND nodoc = noDocu; IF NOT FOUND THEN reponse:=\'Disponible\'; END IF; RETURN reponse; END; ' LANGUAGE 'plpgsql'; The function is created correctly, the PL/pgSQL language is installed correctly and the select works when I execute it directly from psql prompt. But when I call the function with: "SELECT livreEmprunte(1);", I receive: ERROR: fmgr_info: function 20288: cache lookup failed I'm using RedHat Linux 6.0 wth PostgreSQL 6.5.2 What cause my problem? Thank you. Éric Prévost-Dansereau e-mail: eric@esc.rosemere.qc.ca