Re: BUG #18178: New Restriction on "ON SELECT" rules on tables

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: joshua(dot)uyehara(at)gmail(dot)com
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #18178: New Restriction on "ON SELECT" rules on tables
Date: 2023-11-02 14:20:02
Message-ID: 3027424.1698934802@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

PG Bug reporting form <noreply(at)postgresql(dot)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

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message PG Bug reporting form 2023-11-02 17:01:47 BUG #18180: Maybe a bug? repomd.xml signature could not be verified for pgdg-common
Previous Message Marius RAICU 2023-11-02 12:50:55 Re: BUG #18167: cannot create partitioned tables when default_tablespace is set