Forum OpenACS Q&A: Re: Upgrade problems for acs-kernel 4.6.1 -> 4.6.2 on PostgreSQL

PostgreSQL implements a query rewriting system that goes far beyond views in terms of functionality.  This goes 'way back in the history of PostgreSQL, before it's SQL days, when it was just Postgres (with its own query language.)

This query rewriting system allows you to define rules on insert, delete and update statements on a table.

When SQL's VIEW functionality was added to Postgres, the implementor chose to implement them using the existing rules system rather than implement a separate, parallel facility for VIEWs.  The rule you're seeing is a magic rule created as a side effect of the CREATE VIEW statement that originally created the 4.6.1 version of the view.

As to why it's failing, beats me.  That's very strange.  Looks like there's a "dangling rule" for some reason.  Or perhaps a name clash due to truncation?  Yeah, that's probably it ... the generated rule name is probably clashing with another generated rule name in the permissions system due to truncation.

What version of PG are you using?