From: Tom Lane <tgl@sss.pgh.pa.us>
To: joshua.uyehara@gmail.com
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #18178: New Restriction on "ON SELECT" rules on tables
Date: Thu, 02 Nov 2023 10:20:02 -0400
Message-ID: <3027424.1698934802@sss.pgh.pa.us> (raw)
In-Reply-To: <18178-05534d7064044d2d@postgresql.org>
References: <18178-05534d7064044d2d@postgresql.org>
PG Bug reporting form <noreply@postgresql.org> writes:
> The documentation for rules specifically states that "ON SELECT" rules can
> be created on tables (and I have functionality/use cases that rely on that)
> behavior, but pg16 breaks that.
If the documentation still says that, it needs to be updated.
What are you looking at precisely?
> The issue is, basically, that there are broad classes of database
> abstraction middleware that are configured via database introspection at
> runtime and do not understand or implement the concept of updateable views
> and foreign tables. The easiest workaround for that limitation in postgres
> has always been to create a local table stand-in with all operations
> rerouted to the foreign table via rules.
TBH, I don't believe that argument for a second. Pre-v16, what
happened when you added an ON SELECT rule to a table is that *the
table got changed into a view* (which is what caused the bugs
mentioned in the thread Daniel pointed you to). There is no
difference between the subsequent catalog state and what you would
have if you'd just created it as a view in the first place. So
do that and then add whatever non-SELECT rules you need, and you
should be in the same place as before (and your code will still
work with pre-v16 releases, too).
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-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, joshua.uyehara@gmail.com, pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #18178: New Restriction on "ON SELECT" rules on tables
In-Reply-To: <3027424.1698934802@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