In the PL/PgSQL documentation, section "40.6.4. Looping Through Query Results" [1] contains a sample function which refreshes pseudo-materialized views. As 9.3 has proper materialized views, I thought it could do with updating. There was also an erroneous "%s" in a RAISE NOTICE, and I've tweaked the function definition a bit to increase its usefulness as a sample.
[1] http://www.postgresql.org/docs/devel/static/plpgsql-control-structures.html#PLPGSQL-RECORDS-ITERATING Regards Ian Barwick
doc-plpgsql-40.6.4.patch
Description: Binary data
-- Sent via pgsql-docs mailing list (pgsql-docs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-docs