Re: CREATE RULE "_RETURN" and toast tables

Поиск
Список
Период
Сортировка
От Andres Freund
Тема Re: CREATE RULE "_RETURN" and toast tables
Дата
Msg-id 20130220144139.GA5668@awork2.anarazel.de
обсуждение исходный текст
Ответ на Re: CREATE RULE "_RETURN" and toast tables  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: CREATE RULE "_RETURN" and toast tables  (Tom Lane <tgl@sss.pgh.pa.us>)
Список 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

Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: Materialized views WIP patch
Следующее
От: Jehan-Guillaume de Rorthais
Дата:
Сообщение: Re: Unarchived WALs deleted after crash