doc: update PL/pgSQL sample loop function

From: Ian Barwick <ian(dot)barwick(at)2ndquadrant(dot)com>
To: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: doc: update PL/pgSQL sample loop function
Date: 2019-08-29 03:03:08
Message-ID: 9a70d393-7904-4918-c97c-649f6d114b6a@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi

Here:

https://www.postgresql.org/docs/current/plpgsql-control-structures.html#PLPGSQL-RECORDS-ITERATING

we have a sample PL/PgSQL function (dating from at least 7.2) demonstrating
query result loops, which refreshes some pseudo materialized views stored in
a user-defined table.

As we've had proper materialized views since 9.3, I thought it might
be nice to update this with a self-contained sample which can be used
as-is; see attached patch.

(As a side note the current sample function contains a couple of "%s"
placeholders which should be just "%"; a quick search of plpgsql.sgml
shows this is the only place they occur).

Will submit to the next commitfest.

Regards

Ian Barwick

--
Ian Barwick https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

Attachment Content-Type Size
plpgsql-mviews-sample-func-update.1.patch text/x-patch 2.4 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2019-08-29 04:36:06 Re: doc: update PL/pgSQL sample loop function
Previous Message Tom Lane 2019-08-29 01:44:58 Re: Improve error detections in TAP tests by spreading safe_psql