From: Tom Lane <tgl@sss.pgh.pa.us>
To: Daniel Gustafsson <daniel@yesql.se>
Cc: Maxim Yablokov <m.yablokov@postgrespro.ru>
Cc: pgsql-docs@lists.postgresql.org
Subject: Re: Example 43.6. A PL/pgSQL Trigger Function for Maintaining a Summary Table
Date: Fri, 27 Oct 2023 22:16:54 -0400
Message-ID: <1688333.1698459414@sss.pgh.pa.us> (raw)
In-Reply-To: <455CCA8F-4D66-48A1-A6B8-07371D97B4D5@yesql.se>
References: <70f74895-8512-4b2f-8617-2ac0ebcd2e87@postgrespro.ru>
<99AC5F34-FDB6-42A8-867A-CF97F0707F9B@yesql.se>
<fe405123-9cae-4f16-81c0-4e73bec93b81@postgrespro.ru>
<455CCA8F-4D66-48A1-A6B8-07371D97B4D5@yesql.se>
Daniel Gustafsson <daniel@yesql.se> writes:
> Thanks, I'll await pushing and backpatching if Tom who committed it has
> insights into whether it was missed or if it indeed serves a purpose.
Hey, I just pushed that for somebody else, I don't claim authorship ;-)
It seems clear that the example intends to show a star-schema database
where the fact table refers to various dimension tables. But it's
incomplete --- there's no foreign-key constraint on time_key, and
even less infrastructure for product_key or store_key. I don't
have the cited book either, so I don't know how complete the original
example was. Perhaps the bit in the trigger function about forbidding
updates to time_key has something to do with that model.
Anyway, I don't see any reason to object to this patch. The extra
table isn't adding much. My only thought is would it make sense to
change time_key to be a timestamp or timestamptz value?
regards, tom lane
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: tgl@sss.pgh.pa.us, daniel@yesql.se, m.yablokov@postgrespro.ru, pgsql-docs@lists.postgresql.org
Subject: Re: Example 43.6. A PL/pgSQL Trigger Function for Maintaining a Summary Table
In-Reply-To: <1688333.1698459414@sss.pgh.pa.us>
* 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