X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 0E392D1D8DA for ; Tue, 10 Feb 2004 06:43:00 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 17614-01 for ; Tue, 10 Feb 2004 02:42:24 -0400 (AST) Received: from smtp106.mail.sc5.yahoo.com (smtp106.mail.sc5.yahoo.com [66.163.169.226]) by svr1.postgresql.org (Postfix) with SMTP id 85973D1D299 for ; Tue, 10 Feb 2004 02:42:22 -0400 (AST) Received: from unknown (HELO IVESIA67) (sgnerd@203.196.190.138 with login) by smtp106.mail.sc5.yahoo.com with SMTP; 10 Feb 2004 06:42:21 -0000 Message-ID: <006c01c3efa1$2379bde0$7502a8c0@hdsc.com> Reply-To: "Kumar" From: "Kumar" To: "psql" Subject: Error in declaring %rowtype for recurrence Date: Tue, 10 Feb 2004 12:11:41 +0530 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0062_01C3EFCF.0B019E30" 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-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200402/95 X-Sequence-Number: 16786 This is a multi-part message in MIME format. ------=_NextPart_000_0062_01C3EFCF.0B019E30 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Dear Friends, Postgres 7.3.4 on RH Linux 7.2 I am having an table name recurrence under the schema crm. While I refer it= as %rowtype I have error msgs. CREATE OR REPLACE FUNCTION crm.fn_rowtypetest() RETURNS varchar AS 'DECLARE rec_recurrence crm.recurrences%rowtype; BEGIN FOR rec_recurrence IN SELECT * FROM crm.recurrences LOOP RAISE NOTICE 'Hai'; END LOOP; RETURN 'DONE'; END;' LANGUAGE 'plpgsql' VOLATILE; while I execute=20 select crm.fn_rowtypetest() WARNING: plpgsql: ERROR during compile of fn_rowtypetest near line 0 ERROR: cache lookup for type 0 of recurrences.........pg.dropped.16.......= . failed The same function works if I declare that via an record type CREATE OR REPLACE FUNCTION crm.fn_rowtypetest() RETURNS varchar AS 'DECLARE rec_recurrence record; --------------------------------------------------= ---------------------------------------- Note the change here BEGIN FOR rec_recurrence IN SELECT * FROM crm.recurrences LOOP RAISE NOTICE 'Hai'; END LOOP; RETURN 'DONE'; END;' LANGUAGE 'plpgsql' VOLATILE; Why is that so? Anyone can please clear me. Regards Kumar ------=_NextPart_000_0062_01C3EFCF.0B019E30 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Dear Friends,
 
Postgres 7.3.4 on RH Linux 7.2
 
I am having an table name recurrence under the schema c= rm.=20 While I refer it as %rowtype I have error msgs.
 
CREATE OR REPLACE FUNCTION crm.fn_rowtypetest() RE= TURNS=20 varchar=20 AS
'DECLARE
 rec_recurrence crm.recurrences%rowtype;
BEG= IN
FOR=20 rec_recurrence=20 IN SELECT * FROM crm.recurrences LOOP
 &nb= sp;  RAISE=20 NOTICE 'Hai';
END LOOP;
    RETURN=20 'DONE';
END;'
  LANGUAGE 'plpgsql' VOLATILE;
 
while I execute
select crm.fn_rowtypetest()
 
WARNING:  plpgsql: ERROR during compile of fn_rowt= ypetest=20 near line 0
 
ERROR:  cache lookup for type 0 of=20 recurrences.........pg.dropped.16........ failed
The same function works if I declare that via an record= =20 type
 
CREATE OR REPLACE FUNCTION crm.fn_rowtypetest() RE= TURNS=20 varchar AS
'DECLARE
 rec_recurrence record; =20 ---------------------------------------------------------------------------= ---------------=20 Note the change here
BEGIN
FOR rec_recurrence=20 IN SELECT * FROM crm.recurrences LOOP
 &nb= sp;  RAISE=20 NOTICE 'Hai';
END LOOP;
    RETURN=20 'DONE';
END;'
  LANGUAGE 'plpgsql' VOLATILE;
 
 
Why is that so? Anyone can please clear me.
 
Regards
Kumar

------=_NextPart_000_0062_01C3EFCF.0B019E30--