Re: Dropped index on table preventing rule creation

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Dropped index on table preventing rule creation
Дата
Msg-id 12987.1315949508@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Dropped index on table preventing rule creation  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: Dropped index on table preventing rule creation
Список pgsql-bugs
Robert Haas <robertmhaas@gmail.com> writes:
> On Sep 10, 2011, at 11:26 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> (IOW, rather than "fix" this I'd prefer to rip out the code altogether.
>> But maybe we should wait a couple more years for that.)

> IIRC, it's not dead code. I think you can still generate such a dump if you use CREATE OR REPLACE VIEW to manufacture
apair of mutually recursive views. 

Oh, yeah, I'd forgotten about that.  In general that's pg_dump's
strategy for breaking a circular dependency loop that involves a view.

> Now we should probably disallow that, but we currently don't.

Losing that particular case isn't problematic, but I'm not sure that
that's the only possible circularity involving a view.  One idea that
comes to mind is

    create table foo (list-of-columns);

    create function foofunc () returns setof foo as ...;

    create rule .... as select * from foofunc();

This only saves somebody from citing the list of column types twice,
so maybe we could blow off this case too; but who's to say there are
not more-useful cases that would create circularities?

            regards, tom lane

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

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: Dropped index on table preventing rule creation
Следующее
От: "pasman"
Дата:
Сообщение: BUG #6204: Using plperl functions generate crash