Re: BUG #18178: New Restriction on "ON SELECT" rules on tables - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #18178: New Restriction on "ON SELECT" rules on tables
Date
Msg-id 3027424.1698934802@sss.pgh.pa.us
Whole thread Raw
In response to BUG #18178: New Restriction on "ON SELECT" rules on tables  (PG Bug reporting form <noreply@postgresql.org>)
Responses Re: BUG #18178: New Restriction on "ON SELECT" rules on tables  (Joshua Uyehara <joshua.uyehara@gmail.com>)
List pgsql-bugs
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



pgsql-bugs by date:

Previous
From: hubert depesz lubaczewski
Date:
Subject: Re: Logical replication is missing block of rows when sending initial sync?
Next
From: PG Bug reporting form
Date:
Subject: BUG #18180: Maybe a bug? repomd.xml signature could not be verified for pgdg-common