pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedError in declaring %rowtype for recurrence
3+ messages / 2 participants
[nested] [flat]
* Error in declaring %rowtype for recurrence
@ 2004-02-10 06:41 Kumar <sgnerd@yahoo.com.sg>
0 siblings, 1 reply; 3+ messages in thread
From: Kumar @ 2004-02-10 06:41 UTC (permalink / raw)
To: pgsql-sql
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
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
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Error in declaring %rowtype for recurrence
@ 2004-02-10 08:32 Tom Lane <tgl@sss.pgh.pa.us>
parent: Kumar <sgnerd@yahoo.com.sg>
0 siblings, 1 reply; 3+ messages in thread
From: Tom Lane @ 2004-02-10 08:32 UTC (permalink / raw)
To: Kumar <sgnerd@yahoo.com.sg>; +Cc: pgsql-sql
"Kumar" <sgnerd@yahoo.com.sg> writes:
> WARNING: plpgsql: ERROR during compile of fn_rowtypetest near line 0
> ERROR: cache lookup for type 0 of recurrences.........pg.dropped.16.......=
> . failed
PG 7.4 is a little better at dealing with dropped columns in plpgsql
rowtypes.
regards, tom lane
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Error in declaring %rowtype for recurrence
@ 2004-02-10 09:44 Kumar <sgnerd@yahoo.com.sg>
parent: Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 0 replies; 3+ messages in thread
From: Kumar @ 2004-02-10 09:44 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-sql
I am sorry. I didn't get you. Can u pls tell me more
Thanks
kumar
----- Original Message -----
From: "Tom Lane" <tgl@sss.pgh.pa.us>
To: "Kumar" <sgnerd@yahoo.com.sg>
Cc: "psql" <pgsql-sql@postgresql.org>
Sent: Tuesday, February 10, 2004 2:02 PM
Subject: Re: [SQL] Error in declaring %rowtype for recurrence
> "Kumar" <sgnerd@yahoo.com.sg> writes:
> > WARNING: plpgsql: ERROR during compile of fn_rowtypetest near line 0
> > ERROR: cache lookup for type 0 of
recurrences.........pg.dropped.16.......=
> > . failed
>
> PG 7.4 is a little better at dealing with dropped columns in plpgsql
> rowtypes.
>
> regards, tom lane
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2004-02-10 09:44 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2004-02-10 06:41 Error in declaring %rowtype for recurrence Kumar <sgnerd@yahoo.com.sg>
2004-02-10 08:32 ` Tom Lane <tgl@sss.pgh.pa.us>
2004-02-10 09:44 ` Kumar <sgnerd@yahoo.com.sg>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox