Re: CREATE RULE "_RETURN" and toast tables - Mailing list pgsql-hackers

From Andres Freund
Subject Re: CREATE RULE "_RETURN" and toast tables
Date
Msg-id 20130220144139.GA5668@awork2.anarazel.de
Whole thread Raw
In response to Re: CREATE RULE "_RETURN" and toast tables  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: CREATE RULE "_RETURN" and toast tables
List pgsql-hackers
On 2013-02-14 20:47:11 -0500, Tom Lane wrote:
> Andres Freund <andres@2ndquadrant.com> writes:
> > The current behaviour doesn't seem to be a terribly good idea. I propose
> > to drop the toast table and reset the relfrozenxid in DefineQueryRewrite
> > in the RelisBecomingView case.
>
> Yeah, probably worth doing.  At the time we thought that that code path
> was just a short-term legacy thing for loading ancient pg_dump files.
> However, given that even modern pg_dumps will use this syntax if
> necessary to break circular dependencies for views, we're probably never
> going to be rid of it completely.

What about the attached patch? I chose to move the update of relkind
from SetRelationRuleStatus to the RelisBecomingView part of
DefineQueryRewrite. As we're updating pg_class in there anyway there
doesn't seem to be any reason to spread knowledge of that any further.

Andres

--
 Andres Freund                       http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services

Attachment

pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: Materialized views WIP patch
Next
From: Jehan-Guillaume de Rorthais
Date:
Subject: Re: Unarchived WALs deleted after crash