PL/pgSQL doc sample bug? (in 7.1.3)

From: KobayashiJunichi <junichi(at)sra(dot)co(dot)jp>
To: pgsql-hackers(at)postgresql(dot)org
Subject: PL/pgSQL doc sample bug? (in 7.1.3)
Date: 2001-10-09 01:26:08
Message-ID: 3BC25230.99F7DD07@sra.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello,

I could not execute sample code of plsql.sgml. PostgreSQL version is 7.1.3.
Then I made patches for reference.

1) cs_refresh_one_mv function sample code bug. *** 512,526 ****
2) Singule quotation missing. *** 1152,1158 ****
3) cs_refresh_mviews function sample code bug. *** 1305,1313 ****

Please review my patch.
Thank you.

Following plsqlORG.sgml file is a current CVS file.

*** plsqlORG.sgml Fri Oct 5 17:19:53 2001
--- plsql.sgml Fri Oct 5 17:32:16 2001
***************
*** 512,526 ****
WHERE sort_key=key;

IF NOT FOUND THEN
! RAISE EXCEPTION ''View '' || key || '' not found'';
RETURN 0;
END IF;

-- The mv_name column of cs_materialized_views stores view
-- names.

! TRUNCATE TABLE table_data.mv_name;
! INSERT INTO table_data.mv_name || '' '' || table_data.mv_query;

return 1;
end;
--- 512,526 ----
WHERE sort_key=key;

IF NOT FOUND THEN
! RAISE EXCEPTION ''View % not found'',key;
RETURN 0;
END IF;

-- The mv_name column of cs_materialized_views stores view
-- names.

! EXECUTE ''TRUNCATE TABLE '' || quote_ident(table_data.mv_name);
! EXECUTE ''INSERT INTO '' || quote_ident(table_data.mv_name) || '' '' || table_data.mv_query;

return 1;
end;
***************
*** 1152,1158 ****
FOR i IN 1..10 LOOP
-- some expressions here

! RAISE NOTICE 'i is %',i;
END LOOP;

FOR i IN REVERSE 1..10 LOOP
--- 1152,1158 ----
FOR i IN 1..10 LOOP
-- some expressions here

! RAISE NOTICE ''i is %'',i;
END LOOP;

FOR i IN REVERSE 1..10 LOOP
***************
*** 1305,1313 ****

-- Now "mviews" has one record from cs_materialized_views

! PERFORM cs_log(''Refreshing materialized view '' || mview.mv_name || ''...'');
! TRUNCATE TABLE mview.mv_name;
! INSERT INTO mview.mv_name || '' '' || mview.mv_query;
END LOOP;

PERFORM cs_log(''Done refreshing materialized views.'');
--- 1305,1313 ----

-- Now "mviews" has one record from cs_materialized_views

! PERFORM cs_log(''Refreshing materialized view '' || quote_ident(mviews.mv_name) || ''...'');
! EXECUTE ''TRUNCATE TABLE '' || quote_ident(mviews.mv_name);
! EXECUTE ''INSERT INTO '' || quote_ident(mviews.mv_name) || '' '' || mviews.mv_query;
END LOOP;

PERFORM cs_log(''Done refreshing materialized views.'');

---
Junichi Kobayasi

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message John Summerfield 2001-10-09 01:37:30 Re: Temprary issue gripes(was:Re: cvs problem)
Previous Message Brent Verner 2001-10-09 00:18:47 Re: [patch] ALTER RENAME and indexes