pg.ddx.io  pgsql-docs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Maxim Yablokov <m.yablokov@postgrespro.ru>
To: Daniel Gustafsson <daniel@yesql.se>
Cc: pgsql-docs@lists.postgresql.org
Subject: Re: Example 43.6. A PL/pgSQL Trigger Function for Maintaining a Summary Table
Date: Thu, 26 Oct 2023 13:31:07 +0300
Message-ID: <fe405123-9cae-4f16-81c0-4e73bec93b81@postgrespro.ru> (raw)
In-Reply-To: <99AC5F34-FDB6-42A8-867A-CF97F0707F9B@yesql.se>
References: <70f74895-8512-4b2f-8617-2ac0ebcd2e87@postgrespro.ru>
	<99AC5F34-FDB6-42A8-867A-CF97F0707F9B@yesql.se>

I believe that the attached patch should fix this problem. Please have a 
look.

26.10.2023 12:29, Daniel Gustafsson пишет:
>> On 26 Oct 2023, at 09:33, Maxim Yablokov<m.yablokov@postgrespro.ru>  wrote:
>> Example 43.6 on the pagehttps://www.postgresql.org/docs/16/plpgsql-trigger.html  has two tables called main. But it seems that the table time_dimension is not used any further, it's a bit strange for one of main tables of the example. Am I missing something, or should this example be extended (or reduced)?
> Interesting catch, time_dimension has been unused since introduced with commit
> a294726bc1d (in 2005), and the archives doesn't provide any further insights.
> While I don't have access to the book referred to for the example, we don't
> expect our readers to either so it seems to me that we could remove it from the
> example to avoid risk of confusion. Would you like to propose a patch for this?
>
> --
> Daniel Gustafsson
>
-- 
Best regards,
Maxim Yablokov
Technical writer-translator
Postgres Professional <https://postgrespro.com/;

Attachments:

  [text/x-patch] plpgsql-trigger.patch (888B, ../fe405123-9cae-4f16-81c0-4e73bec93b81@postgrespro.ru/3-plpgsql-trigger.patch)
  download | inline diff:
diff --git a/doc/src/sgml/plpgsql.sgml b/doc/src/sgml/plpgsql.sgml
index 83f867f91d2..7103ab03b74 100644
--- a/doc/src/sgml/plpgsql.sgml
+++ b/doc/src/sgml/plpgsql.sgml
@@ -4449,18 +4449,8 @@ INSTEAD OF INSERT OR UPDATE OR DELETE ON emp_view
 
 <programlisting>
 --
--- Main tables - time dimension and sales fact.
+-- Main table - sales fact.
 --
-CREATE TABLE time_dimension (
-    time_key                    integer NOT NULL,
-    day_of_week                 integer NOT NULL,
-    day_of_month                integer NOT NULL,
-    month                       integer NOT NULL,
-    quarter                     integer NOT NULL,
-    year                        integer NOT NULL
-);
-CREATE UNIQUE INDEX time_dimension_key ON time_dimension(time_key);
-
 CREATE TABLE sales_fact (
     time_key                    integer NOT NULL,
     product_key                 integer NOT NULL,


view thread (6+ messages)  latest in thread

Message-ID: <fe405123-9cae-4f16-81c0-4e73bec93b81@postgrespro.ru>
Permalink:  ../fe405123-9cae-4f16-81c0-4e73bec93b81@postgrespro.ru/
Also on:    postgresql.org/message-id/fe405123-9cae-4f16-81c0-4e73bec93b81@postgrespro.ru

 ·  · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-docs@postgresql.org
  Cc: m.yablokov@postgrespro.ru, daniel@yesql.se, pgsql-docs@lists.postgresql.org
  Subject: Re: Example 43.6. A PL/pgSQL Trigger Function for Maintaining a Summary Table
  In-Reply-To: <fe405123-9cae-4f16-81c0-4e73bec93b81@postgrespro.ru>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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